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
6137391a
Commit
6137391a
authored
Oct 13, 2013
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
compiler: Fix handling of imported struct with embedded builtin type.
From-SVN: r203496
parent
713b26d0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
gcc/go/gofrontend/import.h
+5
-0
gcc/go/gofrontend/types.cc
+13
-0
No files found.
gcc/go/gofrontend/import.h
View file @
6137391a
...
...
@@ -149,6 +149,11 @@ class Import
location
()
const
{
return
this
->
location_
;
}
// Return the package we are importing.
Package
*
package
()
const
{
return
this
->
package_
;
}
// Return the next character.
int
peek_char
()
...
...
gcc/go/gofrontend/types.cc
View file @
6137391a
...
...
@@ -5258,6 +5258,19 @@ Struct_type::do_import(Import* imp)
}
Type
*
ftype
=
imp
->
read_type
();
// We don't pack the names of builtin types. In
// Struct_field::is_field_name we cope with a hack. Now we
// need another hack so that we don't accidentally think
// that an embedded builtin type is accessible from another
// package (we know that all the builtin types are not
// exported).
if
(
name
.
empty
()
&&
ftype
->
deref
()
->
named_type
()
!=
NULL
)
{
const
std
::
string
fn
(
ftype
->
deref
()
->
named_type
()
->
name
());
if
(
fn
[
0
]
>=
'a'
&&
fn
[
0
]
<=
'z'
)
name
=
'.'
+
imp
->
package
()
->
pkgpath
()
+
'.'
+
fn
;
}
Struct_field
sf
(
Typed_identifier
(
name
,
ftype
,
imp
->
location
()));
if
(
imp
->
peek_char
()
==
' '
)
...
...
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