From 4955456b2d7bf1e6bc82d5240fd46ec9c28f6386 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 16 Dec 2010 00:15:16 +0000 Subject: [PATCH] Don't crash with go or defer of bad call. From-SVN: r167886 --- gcc/go/gofrontend/statements.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gcc/go/gofrontend/statements.cc b/gcc/go/gofrontend/statements.cc index 2d17797c9dd..f77764f68aa 100644 --- a/gcc/go/gofrontend/statements.cc +++ b/gcc/go/gofrontend/statements.cc @@ -1812,7 +1812,13 @@ Thunk_statement::simplify_statement(Gogo* gogo, Block* block) Call_expression* ce = this->call_->call_expression(); Function_type* fntype = ce->get_function_type(); - if (fntype == NULL || this->is_simple(fntype)) + if (fntype == NULL) + { + gcc_assert(saw_errors()); + this->set_is_error(); + return false; + } + if (this->is_simple(fntype)) return false; Expression* fn = ce->fn(); -- 2.30.2