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
10a0275d
Commit
10a0275d
authored
Dec 14, 2010
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix comparison of string and interface types.
From-SVN: r167826
parent
002d4675
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
9 deletions
+7
-9
gcc/go/gofrontend/expressions.cc
+7
-9
No files found.
gcc/go/gofrontend/expressions.cc
View file @
10a0275d
...
@@ -5938,9 +5938,8 @@ Expression::comparison_tree(Translate_context* context, Operator op,
...
@@ -5938,9 +5938,8 @@ Expression::comparison_tree(Translate_context* context, Operator op,
gcc_unreachable
();
gcc_unreachable
();
}
}
if
(
left_type
->
is_string_type
())
if
(
left_type
->
is_string_type
()
&&
right_type
->
is_string_type
()
)
{
{
gcc_assert
(
right_type
->
is_string_type
());
tree
string_type
=
Type
::
make_string_type
()
->
get_tree
(
context
->
gogo
());
tree
string_type
=
Type
::
make_string_type
()
->
get_tree
(
context
->
gogo
());
static
tree
string_compare_decl
;
static
tree
string_compare_decl
;
left_tree
=
Gogo
::
call_builtin
(
&
string_compare_decl
,
left_tree
=
Gogo
::
call_builtin
(
&
string_compare_decl
,
...
@@ -5954,13 +5953,12 @@ Expression::comparison_tree(Translate_context* context, Operator op,
...
@@ -5954,13 +5953,12 @@ Expression::comparison_tree(Translate_context* context, Operator op,
right_tree
);
right_tree
);
right_tree
=
build_int_cst_type
(
integer_type_node
,
0
);
right_tree
=
build_int_cst_type
(
integer_type_node
,
0
);
}
}
else
if
((
left_type
->
interface_type
()
!=
NULL
if
((
left_type
->
interface_type
()
!=
NULL
&&
right_type
->
interface_type
()
==
NULL
&&
right_type
->
interface_type
()
==
NULL
&&
!
right_type
->
is_nil_type
())
&&
!
right_type
->
is_nil_type
())
||
(
left_type
->
interface_type
()
==
NULL
||
(
left_type
->
interface_type
()
==
NULL
&&
!
left_type
->
is_nil_type
()
&&
!
left_type
->
is_nil_type
()
&&
right_type
->
interface_type
()
!=
NULL
))
&&
right_type
->
interface_type
()
!=
NULL
))
{
{
// Comparing an interface value to a non-interface value.
// Comparing an interface value to a non-interface value.
if
(
left_type
->
interface_type
()
==
NULL
)
if
(
left_type
->
interface_type
()
==
NULL
)
...
...
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