Commit 6997f696 by Ian Lance Taylor

Don't crash on erroneous result variable.

Fixes issue 1320.

From-SVN: r167573
parent c658f0ce
......@@ -1550,14 +1550,18 @@ Function::build_tree(Gogo* gogo, Named_object* named_function)
else if ((*p)->is_result_variable())
{
tree var_decl = (*p)->get_tree(gogo, named_function);
if ((*p)->result_var_value()->is_in_heap())
if (var_decl != error_mark_node
&& (*p)->result_var_value()->is_in_heap())
{
gcc_assert(TREE_CODE(var_decl) == INDIRECT_REF);
var_decl = TREE_OPERAND(var_decl, 0);
}
gcc_assert(TREE_CODE(var_decl) == VAR_DECL);
DECL_CHAIN(var_decl) = declare_vars;
declare_vars = var_decl;
if (var_decl != error_mark_node)
{
gcc_assert(TREE_CODE(var_decl) == VAR_DECL);
DECL_CHAIN(var_decl) = declare_vars;
declare_vars = var_decl;
}
}
}
*pp = NULL_TREE;
......
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