projects
/
gcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9ff48ac
)
Don't crash on calling new with an erroneous type.
author
Ian Lance Taylor
<ian@gcc.gnu.org>
Tue, 21 Dec 2010 23:19:43 +0000
(23:19 +0000)
committer
Ian Lance Taylor
<ian@gcc.gnu.org>
Tue, 21 Dec 2010 23:19:43 +0000
(23:19 +0000)
From-SVN: r168144
gcc/go/gofrontend/expressions.cc
patch
|
blob
|
history
diff --git
a/gcc/go/gofrontend/expressions.cc
b/gcc/go/gofrontend/expressions.cc
index 5cd9e66c489aec602f3182a6c94ec3e72e5b8b90..faea908a3bbf9528855790565cddaad8fc3551f0 100644
(file)
--- a/
gcc/go/gofrontend/expressions.cc
+++ b/
gcc/go/gofrontend/expressions.cc
@@
-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);
}