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
72f812a2
Commit
72f812a2
authored
Feb 15, 2011
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't crash lowering self-referential variable initializer.
From-SVN: r170194
parent
1c4a5fc8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
1 deletions
+17
-1
gcc/go/gofrontend/gogo.cc
+17
-1
No files found.
gcc/go/gofrontend/gogo.cc
View file @
72f812a2
...
...
@@ -1139,7 +1139,8 @@ class Lower_parse_tree : public Traverse
{
public
:
Lower_parse_tree
(
Gogo
*
gogo
,
Named_object
*
function
)
:
Traverse
(
traverse_constants
:
Traverse
(
traverse_variables
|
traverse_constants
|
traverse_functions
|
traverse_statements
|
traverse_expressions
),
...
...
@@ -1147,6 +1148,9 @@ class Lower_parse_tree : public Traverse
{
}
int
variable
(
Named_object
*
);
int
constant
(
Named_object
*
,
bool
);
int
...
...
@@ -1167,6 +1171,18 @@ class Lower_parse_tree : public Traverse
int
iota_value_
;
};
// Lower variables. We handle variables specially to break loops in
// which a variable initialization expression refers to itself. The
// loop breaking is in lower_init_expression.
int
Lower_parse_tree
::
variable
(
Named_object
*
no
)
{
if
(
no
->
is_variable
())
no
->
var_value
()
->
lower_init_expression
(
this
->
gogo_
,
this
->
function_
);
return
TRAVERSE_CONTINUE
;
}
// Lower constants. We handle constants specially so that we can set
// the right value for the predeclared constant iota. This works in
// conjunction with the way we lower Const_expression objects.
...
...
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