Commit 67eff3d9 by Ian Lance Taylor

Don't crash on calling new with an erroneous type.

From-SVN: r168144
parent 9ff48ac3
......@@ -10242,9 +10242,13 @@ tree
Allocation_expression::do_get_tree(Translate_context* context)
{
tree type_tree = this->type_->get_tree(context->gogo());
if (type_tree == error_mark_node)
return error_mark_node;
tree size_tree = TYPE_SIZE_UNIT(type_tree);
tree space = context->gogo()->allocate_memory(this->type_, size_tree,
this->location());
if (space == error_mark_node)
return error_mark_node;
return fold_convert(build_pointer_type(type_tree), space);
}
......
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