diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2011-02-23 05:10:05 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2011-02-23 05:10:05 +0000 |
commit | f315816c37c235b0f99593080501c2e3855c3568 (patch) | |
tree | 03ab9025777eeb4bd45e35a29e2e486bfd42f4f1 | |
parent | 6d61c698747eb439a6543c54443d2184f91b5051 (diff) | |
download | gcc-f315816c37c235b0f99593080501c2e3855c3568.zip gcc-f315816c37c235b0f99593080501c2e3855c3568.tar.gz gcc-f315816c37c235b0f99593080501c2e3855c3568.tar.bz2 |
Don't crash on Sizeof of bad type.
From-SVN: r170430
-rw-r--r-- | gcc/go/gofrontend/expressions.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc index 050942c..e9a26a0 100644 --- a/gcc/go/gofrontend/expressions.cc +++ b/gcc/go/gofrontend/expressions.cc @@ -7980,7 +7980,11 @@ Builtin_call_expression::do_get_tree(Translate_context* context) mpz_init(val); Type* dummy; bool b = this->integer_constant_value(true, val, &dummy); - gcc_assert(b); + if (!b) + { + gcc_assert(saw_errors()); + return error_mark_node; + } tree type = Type::lookup_integer_type("int")->get_tree(gogo); tree ret = Expression::integer_constant_tree(val, type); mpz_clear(val); |