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
6540ddba
Commit
6540ddba
authored
14 years ago
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't crash on type switch of nil.
From-SVN: r170455
parent
d6007535
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
gcc/go/gofrontend/statements.cc
+5
-2
No files found.
gcc/go/gofrontend/statements.cc
View file @
6540ddba
...
...
@@ -3905,10 +3905,13 @@ Type_switch_statement::do_lower(Gogo*, Block* enclosing)
{
// Doing a type switch on a non-interface type. Should we issue
// a warning for this case?
// descriptor_temp = DESCRIPTOR
Expression
*
lhs
=
Expression
::
make_temporary_reference
(
descriptor_temp
,
loc
);
Expression
*
rhs
=
Expression
::
make_type_descriptor
(
val_type
,
loc
);
Expression
*
rhs
;
if
(
val_type
->
is_nil_type
())
rhs
=
Expression
::
make_nil
(
loc
);
else
rhs
=
Expression
::
make_type_descriptor
(
val_type
,
loc
);
Statement
*
s
=
Statement
::
make_assignment
(
lhs
,
rhs
,
loc
);
b
->
add_statement
(
s
);
}
...
...
This diff is collapsed.
Click to expand it.
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