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
114d8843
Commit
114d8843
authored
Dec 04, 2012
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
compiler: Don't permit go/defer argument to be parenthesized.
Fixes Go repository issue 4468. From-SVN: r194112
parent
9394665e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
gcc/go/gofrontend/parse.cc
+6
-3
No files found.
gcc/go/gofrontend/parse.cc
View file @
114d8843
...
@@ -4089,13 +4089,16 @@ Parse::go_or_defer_stat()
...
@@ -4089,13 +4089,16 @@ Parse::go_or_defer_stat()
||
this
->
peek_token
()
->
is_keyword
(
KEYWORD_DEFER
));
||
this
->
peek_token
()
->
is_keyword
(
KEYWORD_DEFER
));
bool
is_go
=
this
->
peek_token
()
->
is_keyword
(
KEYWORD_GO
);
bool
is_go
=
this
->
peek_token
()
->
is_keyword
(
KEYWORD_GO
);
Location
stat_location
=
this
->
location
();
Location
stat_location
=
this
->
location
();
this
->
advance_token
();
const
Token
*
token
=
this
->
advance_token
();
Location
expr_location
=
this
->
location
();
Location
expr_location
=
this
->
location
();
bool
is_parenthesized
=
token
->
is_op
(
OPERATOR_LPAREN
);
Expression
*
expr
=
this
->
expression
(
PRECEDENCE_NORMAL
,
false
,
true
,
NULL
);
Expression
*
expr
=
this
->
expression
(
PRECEDENCE_NORMAL
,
false
,
true
,
NULL
);
Call_expression
*
call_expr
=
expr
->
call_expression
();
Call_expression
*
call_expr
=
expr
->
call_expression
();
if
(
call_expr
==
NULL
)
if
(
is_parenthesized
||
call_expr
==
NULL
)
{
{
error_at
(
expr_location
,
"
expected call expression
"
);
error_at
(
expr_location
,
"
argument to go/defer must be function call
"
);
return
;
return
;
}
}
...
...
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