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
c59a4d0f
Commit
c59a4d0f
authored
Jun 07, 2012
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
compiler: Fix unsafe.Sizeof for named structs with named struct fields.
From-SVN: r188295
parent
cba0366c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
gcc/go/gofrontend/types.cc
+9
-0
gcc/go/gofrontend/types.h
+5
-2
No files found.
gcc/go/gofrontend/types.cc
View file @
c59a4d0f
...
...
@@ -7863,6 +7863,10 @@ Find_type_use::type(Type* type)
bool
Named_type
::
do_verify
()
{
if
(
this
->
is_verified_
)
return
true
;
this
->
is_verified_
=
true
;
Find_type_use
find
(
this
);
Type
::
traverse
(
this
->
type_
,
&
find
);
if
(
find
.
found
())
...
...
@@ -7973,6 +7977,11 @@ Named_type::convert(Gogo* gogo)
this
->
create_placeholder
(
gogo
);
// If we are called to turn unsafe.Sizeof into a constant, we may
// not have verified the type yet. We have to make sure it is
// verified, since that sets the list of dependencies.
this
->
verify
();
// Convert all the dependencies. If they refer indirectly back to
// this type, they will pick up the intermediate tree we just
// created.
...
...
gcc/go/gofrontend/types.h
View file @
c59a4d0f
...
...
@@ -2628,8 +2628,9 @@ class Named_type : public Type
interface_method_tables_
(
NULL
),
pointer_interface_method_tables_
(
NULL
),
location_
(
location
),
named_btype_
(
NULL
),
dependencies_
(),
is_visible_
(
true
),
is_error_
(
false
),
is_placeholder_
(
false
),
is_converted_
(
false
),
is_circular_
(
false
),
seen_
(
false
),
seen_in_compare_is_identity_
(
false
),
seen_in_get_backend_
(
false
)
is_converted_
(
false
),
is_circular_
(
false
),
is_verified_
(
false
),
seen_
(
false
),
seen_in_compare_is_identity_
(
false
),
seen_in_get_backend_
(
false
)
{
}
// Return the associated Named_object. This holds the actual name.
...
...
@@ -2908,6 +2909,8 @@ class Named_type : public Type
// Whether this is a pointer or function type which refers to the
// type itself.
bool
is_circular_
;
// Whether this type has been verified.
bool
is_verified_
;
// In a recursive operation such as has_hidden_fields, this flag is
// used to prevent infinite recursion when a type refers to itself.
// This is mutable because it is always reset to false when the
...
...
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