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
106aaf4f
Commit
106aaf4f
authored
Jan 31, 2015
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
compiler: Treat map index expressions as lvalues in range expressions.
Fixes golang/go#9695. From-SVN: r220301
parent
a6b483da
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
gcc/go/gofrontend/parse.cc
+11
-8
No files found.
gcc/go/gofrontend/parse.cc
View file @
106aaf4f
...
...
@@ -4011,6 +4011,16 @@ Parse::tuple_assignment(Expression_list* lhs, bool may_be_composite_lit,
token
=
this
->
advance_token
();
if
(
lhs
==
NULL
)
return
;
// Map expressions act differently when they are lvalues.
for
(
Expression_list
::
iterator
plv
=
lhs
->
begin
();
plv
!=
lhs
->
end
();
++
plv
)
if
((
*
plv
)
->
index_expression
()
!=
NULL
)
(
*
plv
)
->
index_expression
()
->
set_is_lvalue
();
if
(
p_range_clause
!=
NULL
&&
token
->
is_keyword
(
KEYWORD_RANGE
))
{
if
(
op
!=
OPERATOR_EQ
)
...
...
@@ -4023,7 +4033,7 @@ Parse::tuple_assignment(Expression_list* lhs, bool may_be_composite_lit,
may_be_composite_lit
);
// We've parsed everything; check for errors.
if
(
lhs
==
NULL
||
vals
==
NULL
)
if
(
vals
==
NULL
)
return
;
for
(
Expression_list
::
const_iterator
pe
=
lhs
->
begin
();
pe
!=
lhs
->
end
();
...
...
@@ -4042,13 +4052,6 @@ Parse::tuple_assignment(Expression_list* lhs, bool may_be_composite_lit,
return
;
}
// Map expressions act differently when they are lvalues.
for
(
Expression_list
::
iterator
plv
=
lhs
->
begin
();
plv
!=
lhs
->
end
();
++
plv
)
if
((
*
plv
)
->
index_expression
()
!=
NULL
)
(
*
plv
)
->
index_expression
()
->
set_is_lvalue
();
Call_expression
*
call
;
Index_expression
*
map_index
;
Receive_expression
*
receive
;
...
...
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