Commit f315816c by Ian Lance Taylor

Don't crash on Sizeof of bad type.

From-SVN: r170430
parent 6d61c698
...@@ -7980,7 +7980,11 @@ Builtin_call_expression::do_get_tree(Translate_context* context) ...@@ -7980,7 +7980,11 @@ Builtin_call_expression::do_get_tree(Translate_context* context)
mpz_init(val); mpz_init(val);
Type* dummy; Type* dummy;
bool b = this->integer_constant_value(true, val, &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 type = Type::lookup_integer_type("int")->get_tree(gogo);
tree ret = Expression::integer_constant_tree(val, type); tree ret = Expression::integer_constant_tree(val, type);
mpz_clear(val); mpz_clear(val);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment