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
ada24741
Commit
ada24741
authored
Oct 16, 2014
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
compiler: Don't record interface types with blank type names.
Fixes issue 8079. From-SVN: r216343
parent
f6e31dff
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
5 deletions
+12
-5
gcc/go/gofrontend/parse.cc
+11
-4
gcc/go/gofrontend/parse.h
+1
-1
No files found.
gcc/go/gofrontend/parse.cc
View file @
ada24741
...
@@ -245,7 +245,7 @@ Parse::type()
...
@@ -245,7 +245,7 @@ Parse::type()
||
token
->
is_op
(
OPERATOR_CHANOP
))
||
token
->
is_op
(
OPERATOR_CHANOP
))
return
this
->
channel_type
();
return
this
->
channel_type
();
else
if
(
token
->
is_keyword
(
KEYWORD_INTERFACE
))
else
if
(
token
->
is_keyword
(
KEYWORD_INTERFACE
))
return
this
->
interface_type
();
return
this
->
interface_type
(
true
);
else
if
(
token
->
is_keyword
(
KEYWORD_FUNC
))
else
if
(
token
->
is_keyword
(
KEYWORD_FUNC
))
{
{
Location
location
=
token
->
location
();
Location
location
=
token
->
location
();
...
@@ -1179,7 +1179,7 @@ Parse::block()
...
@@ -1179,7 +1179,7 @@ Parse::block()
// MethodSpecList = MethodSpec { ";" MethodSpec } [ ";" ] .
// MethodSpecList = MethodSpec { ";" MethodSpec } [ ";" ] .
Type
*
Type
*
Parse
::
interface_type
()
Parse
::
interface_type
(
bool
record
)
{
{
go_assert
(
this
->
peek_token
()
->
is_keyword
(
KEYWORD_INTERFACE
));
go_assert
(
this
->
peek_token
()
->
is_keyword
(
KEYWORD_INTERFACE
));
Location
location
=
this
->
location
();
Location
location
=
this
->
location
();
...
@@ -1227,7 +1227,8 @@ Parse::interface_type()
...
@@ -1227,7 +1227,8 @@ Parse::interface_type()
}
}
Interface_type
*
ret
=
Type
::
make_interface_type
(
methods
,
location
);
Interface_type
*
ret
=
Type
::
make_interface_type
(
methods
,
location
);
this
->
gogo_
->
record_interface_type
(
ret
);
if
(
record
)
this
->
gogo_
->
record_interface_type
(
ret
);
return
ret
;
return
ret
;
}
}
...
@@ -1526,7 +1527,13 @@ Parse::type_spec(void*)
...
@@ -1526,7 +1527,13 @@ Parse::type_spec(void*)
}
}
Type
*
type
;
Type
*
type
;
if
(
!
this
->
peek_token
()
->
is_op
(
OPERATOR_SEMICOLON
))
if
(
name
==
"_"
&&
this
->
peek_token
()
->
is_keyword
(
KEYWORD_INTERFACE
))
{
// We call Parse::interface_type explicity here because we do not want
// to record an interface with a blank type name.
type
=
this
->
interface_type
(
false
);
}
else
if
(
!
this
->
peek_token
()
->
is_op
(
OPERATOR_SEMICOLON
))
type
=
this
->
type
();
type
=
this
->
type
();
else
else
{
{
...
...
gcc/go/gofrontend/parse.h
View file @
ada24741
...
@@ -182,7 +182,7 @@ class Parse
...
@@ -182,7 +182,7 @@ class Parse
void
parameter_decl
(
bool
,
Typed_identifier_list
*
,
bool
*
,
bool
*
,
bool
*
);
void
parameter_decl
(
bool
,
Typed_identifier_list
*
,
bool
*
,
bool
*
,
bool
*
);
bool
result
(
Typed_identifier_list
**
);
bool
result
(
Typed_identifier_list
**
);
Location
block
();
Location
block
();
Type
*
interface_type
();
Type
*
interface_type
(
bool
record
);
void
method_spec
(
Typed_identifier_list
*
);
void
method_spec
(
Typed_identifier_list
*
);
void
declaration
();
void
declaration
();
bool
declaration_may_start_here
();
bool
declaration_may_start_here
();
...
...
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