projects
/
gcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6540ddb
)
Don't crash on type switch of untyped value.
author
Ian Lance Taylor
<ian@gcc.gnu.org>
Thu, 24 Feb 2011 04:02:33 +0000
(
04:02
+0000)
committer
Ian Lance Taylor
<ian@gcc.gnu.org>
Thu, 24 Feb 2011 04:02:33 +0000
(
04:02
+0000)
From-SVN: r170456
gcc/go/gofrontend/statements.cc
patch
|
blob
|
history
diff --git
a/gcc/go/gofrontend/statements.cc
b/gcc/go/gofrontend/statements.cc
index 629fdd8161519f54cec55ae29f929ff20403a088..c87574dff1c940adbe146d2f8a5dda22ca1c9c20 100644
(file)
--- a/
gcc/go/gofrontend/statements.cc
+++ b/
gcc/go/gofrontend/statements.cc
@@
-3911,7
+3911,11
@@
Type_switch_statement::do_lower(Gogo*, Block* enclosing)
if (val_type->is_nil_type())
rhs = Expression::make_nil(loc);
else
- rhs = Expression::make_type_descriptor(val_type, loc);
+ {
+ if (val_type->is_abstract())
+ val_type = val_type->make_non_abstract_type();
+ rhs = Expression::make_type_descriptor(val_type, loc);
+ }
Statement* s = Statement::make_assignment(lhs, rhs, loc);
b->add_statement(s);
}