Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
c86f25e8
Commit
c86f25e8
authored
Nov 01, 2009
by
Jason Merrill
Committed by
Jason Merrill
Nov 01, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* rtti.c (tinfo_name): Fix lengths for private case.
From-SVN: r153789
parent
691a1b27
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
3 deletions
+30
-3
gcc/cp/ChangeLog
+4
-0
gcc/cp/rtti.c
+3
-3
gcc/testsuite/ChangeLog
+2
-0
gcc/testsuite/g++.dg/rtti/typeid9.C
+21
-0
No files found.
gcc/cp/ChangeLog
View file @
c86f25e8
2009-10-31 Jason Merrill <jason@redhat.com>
2009-10-31 Jason Merrill <jason@redhat.com>
* rtti.c (tinfo_name): Fix lengths for private case.
2009-10-31 Jason Merrill <jason@redhat.com>
PR c++/41754
PR c++/41754
* call.c (compare_ics): Avoid bad union use when
* call.c (compare_ics): Avoid bad union use when
comparing two ck_lists.
comparing two ck_lists.
...
...
gcc/cp/rtti.c
View file @
c86f25e8
...
@@ -364,10 +364,10 @@ tinfo_name (tree type, bool mark_private)
...
@@ -364,10 +364,10 @@ tinfo_name (tree type, bool mark_private)
if
(
mark_private
)
if
(
mark_private
)
{
{
/* Inject '*' at beginning of name to force pointer comparison. */
/* Inject '*' at beginning of name to force pointer comparison. */
char
*
buf
=
(
char
*
)
XALLOCAVEC
(
char
,
length
+
1
);
char
*
buf
=
(
char
*
)
XALLOCAVEC
(
char
,
length
+
2
);
buf
[
0
]
=
'*'
;
buf
[
0
]
=
'*'
;
memcpy
(
buf
+
1
,
name
,
length
);
memcpy
(
buf
+
1
,
name
,
length
+
1
);
name_string
=
build_string
(
length
+
1
,
buf
);
name_string
=
build_string
(
length
+
2
,
buf
);
}
}
else
else
name_string
=
build_string
(
length
+
1
,
name
);
name_string
=
build_string
(
length
+
1
,
name
);
...
...
gcc/testsuite/ChangeLog
View file @
c86f25e8
2009-10-31 Jason Merrill <jason@redhat.com>
2009-10-31 Jason Merrill <jason@redhat.com>
* g++.dg/rtti/typeid9.C: New.
PR c++/41754
PR c++/41754
* g++.dg/cpp0x/initlist25.C: New.
* g++.dg/cpp0x/initlist25.C: New.
...
...
gcc/testsuite/g++.dg/rtti/typeid9.C
0 → 100644
View file @
c86f25e8
// Test that the typeid name for a local class is properly null-terminated.
// { dg-do run }
#include <string.h>
#include <typeinfo>
#include <stdio.h>
int
f
()
{
struct
A
{};
struct
B
{};
const
std
::
type_info
&
ti
=
typeid
(
A
);
const
std
::
type_info
&
ti2
=
typeid
(
B
);
puts
(
ti
.
name
());
puts
(
ti2
.
name
());
return
strcmp
(
ti
.
name
(),
"Z1fvE1A"
)
||
strcmp
(
ti2
.
name
(),
"Z1fvE1B"
);
}
int
main
()
{
return
f
();
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment