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
8e6c2a27
Commit
8e6c2a27
authored
Dec 22, 2010
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't crash if a constant initializer refers to the constant.
From-SVN: r168162
parent
ecdacbb3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
gcc/go/gofrontend/expressions.cc
+3
-2
gcc/go/gofrontend/gogo.cc
+2
-2
No files found.
gcc/go/gofrontend/expressions.cc
View file @
8e6c2a27
...
...
@@ -2528,7 +2528,9 @@ Const_expression::do_type()
if
(
this
->
type_
!=
NULL
)
return
this
->
type_
;
if
(
this
->
seen_
)
Named_constant
*
nc
=
this
->
constant_
->
const_value
();
if
(
this
->
seen_
||
nc
->
lowering
())
{
this
->
report_error
(
_
(
"constant refers to itself"
));
this
->
type_
=
Type
::
make_error_type
();
...
...
@@ -2537,7 +2539,6 @@ Const_expression::do_type()
this
->
seen_
=
true
;
Named_constant
*
nc
=
this
->
constant_
->
const_value
();
Type
*
ret
=
nc
->
type
();
if
(
ret
!=
NULL
)
...
...
gcc/go/gofrontend/gogo.cc
View file @
8e6c2a27
...
...
@@ -1163,8 +1163,8 @@ Lower_parse_tree::constant(Named_object* no, bool)
{
Named_constant
*
nc
=
no
->
const_value
();
//
We can recursively a constant if the
initializer expression
//
manages to refer to
itself.
//
Don't get into trouble if the constant's
initializer expression
//
refers to the constant
itself.
if
(
nc
->
lowering
())
return
TRAVERSE_CONTINUE
;
nc
->
set_lowering
();
...
...
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