projects
/
gcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4834776
)
Don't crash on attempt to index array type expression.
author
Ian Lance Taylor
<ian@gcc.gnu.org>
Tue, 22 Feb 2011 03:16:38 +0000
(
03:16
+0000)
committer
Ian Lance Taylor
<ian@gcc.gnu.org>
Tue, 22 Feb 2011 03:16:38 +0000
(
03:16
+0000)
From-SVN: r170387
gcc/go/gofrontend/expressions.cc
patch
|
blob
|
history
diff --git
a/gcc/go/gofrontend/expressions.cc
b/gcc/go/gofrontend/expressions.cc
index 8b064e617f56d6773e1e47b46d92db6c621044e8..b58792c20650e011a690496f076687d748d874ff 100644
(file)
--- a/
gcc/go/gofrontend/expressions.cc
+++ b/
gcc/go/gofrontend/expressions.cc
@@
-9034,6
+9034,11
@@
Index_expression::do_lower(Gogo*, Named_object*, int)
Type* type = left->type();
if (type->is_error_type())
return Expression::make_error(location);
+ else if (left->is_type_expression())
+ {
+ error_at(location, "attempt to index type expression");
+ return Expression::make_error(location);
+ }
else if (type->array_type() != NULL)
return Expression::make_array_index(left, start, end, location);
else if (type->points_to() != NULL