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
ea3ef06a
Commit
ea3ef06a
authored
May 30, 2012
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
compiler: Don't crash for invalid constant types for && or ||.
From-SVN: r188033
parent
fda33f15
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
15 deletions
+3
-15
gcc/go/gofrontend/expressions.cc
+3
-15
No files found.
gcc/go/gofrontend/expressions.cc
View file @
ea3ef06a
...
...
@@ -4475,9 +4475,8 @@ Binary_expression::eval_constant(Operator op, Numeric_constant* left_nc,
case
OPERATOR_LE
:
case
OPERATOR_GT
:
case
OPERATOR_GE
:
// These return boolean values and as such must be handled
// elsewhere.
go_unreachable
();
// These return boolean values, not numeric.
return
false
;
default
:
break
;
}
...
...
@@ -5304,24 +5303,13 @@ Binary_expression::operand_address(Statement_inserter* inserter,
bool
Binary_expression
::
do_numeric_constant_value
(
Numeric_constant
*
nc
)
const
{
Operator
op
=
this
->
op_
;
if
(
op
==
OPERATOR_EQEQ
||
op
==
OPERATOR_NOTEQ
||
op
==
OPERATOR_LT
||
op
==
OPERATOR_LE
||
op
==
OPERATOR_GT
||
op
==
OPERATOR_GE
)
return
false
;
Numeric_constant
left_nc
;
if
(
!
this
->
left_
->
numeric_constant_value
(
&
left_nc
))
return
false
;
Numeric_constant
right_nc
;
if
(
!
this
->
right_
->
numeric_constant_value
(
&
right_nc
))
return
false
;
return
Binary_expression
::
eval_constant
(
op
,
&
left_nc
,
&
right_nc
,
return
Binary_expression
::
eval_constant
(
this
->
op_
,
&
left_nc
,
&
right_nc
,
this
->
location
(),
nc
);
}
...
...
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