aboutsummaryrefslogtreecommitdiff
path: root/gcc/go/gofrontend/expressions.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/go/gofrontend/expressions.cc')
-rw-r--r--gcc/go/gofrontend/expressions.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc
index 488c76c..1c329b8 100644
--- a/gcc/go/gofrontend/expressions.cc
+++ b/gcc/go/gofrontend/expressions.cc
@@ -6885,11 +6885,6 @@ Builtin_call_expression::do_flatten(Gogo*, Named_object*,
Statement_inserter* inserter)
{
Location loc = this->location();
- if (this->is_erroneous_call())
- {
- go_assert(saw_errors());
- return Expression::make_error(loc);
- }
switch (this->code_)
{
@@ -8064,6 +8059,13 @@ Builtin_call_expression::do_get_backend(Translate_context* context)
{
Gogo* gogo = context->gogo();
Location location = this->location();
+
+ if (this->is_erroneous_call())
+ {
+ go_assert(saw_errors());
+ return gogo->backend()->error_expression();
+ }
+
switch (this->code_)
{
case BUILTIN_INVALID: