projects
/
gcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6430af3
)
Don't crash on array type with erroneous length expression.
author
Ian Lance Taylor
<ian@gcc.gnu.org>
Wed, 22 Dec 2010 16:47:53 +0000
(16:47 +0000)
committer
Ian Lance Taylor
<ian@gcc.gnu.org>
Wed, 22 Dec 2010 16:47:53 +0000
(16:47 +0000)
From-SVN: r168176
gcc/go/gofrontend/types.cc
patch
|
blob
|
history
diff --git
a/gcc/go/gofrontend/types.cc
b/gcc/go/gofrontend/types.cc
index c0914cac78e520f0c358b600832d9b32b5137362..7a9bfc74028403a8871f6219472afe569cd5e335 100644
(file)
--- a/
gcc/go/gofrontend/types.cc
+++ b/
gcc/go/gofrontend/types.cc
@@
-4359,8
+4359,12
@@
Array_type::get_length_tree(Gogo* gogo)
// expression. FIXME: This won't work in general.
Translate_context context(gogo, NULL, NULL, NULL_TREE);
tree len = this->length_->get_tree(&context);
- len = convert_to_integer(integer_type_node, len);
- this->length_tree_ = save_expr(len);
+ if (len != error_mark_node)
+ {
+ len = convert_to_integer(integer_type_node, len);
+ len = save_expr(len);
+ }
+ this->length_tree_ = len;
}
}
return this->length_tree_;