Commit 3338038a by Ian Lance Taylor

Avoid some crashes on erroneous programs.

From-SVN: r167670
parent d3de3f21
......@@ -1146,7 +1146,11 @@ Func_expression::get_tree_without_closure(Gogo* gogo)
}
Named_object* no = this->function_;
tree id = this->function_->get_id(gogo);
tree id = no->get_id(gogo);
if (id == error_mark_node)
return error_mark_node;
tree fndecl;
if (no->is_function())
fndecl = no->func_value()->get_or_make_decl(gogo, no, id);
......@@ -1155,6 +1159,9 @@ Func_expression::get_tree_without_closure(Gogo* gogo)
else
gcc_unreachable();
if (fndecl == error_mark_node)
return error_mark_node;
return build_fold_addr_expr_loc(this->location(), fndecl);
}
......
......@@ -6864,6 +6864,8 @@ Named_type::do_get_tree(Gogo* gogo)
t = make_node(RECORD_TYPE);
this->named_tree_ = t;
t = this->type_->interface_type()->fill_in_tree(gogo, t);
if (t == error_mark_node)
return error_mark_node;
}
break;
......
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