Skip to content

Commit

Permalink
compiler: Report errors for malformed builtin calls.
Browse files Browse the repository at this point in the history
Errors reported from malformed builtin calls are handled in a later
pass than the one in which they are detected.  If a malformed builtin
call is lowered into an error expression too early, these errors will
never be reported.

Fixes golang/go#11561.

Change-Id: I9c92e92445eb9206b8f4b44949bb126209a82b31
Reviewed-on: https://go-review.googlesource.com/12778
Reviewed-by: Ian Lance Taylor <iant@golang.org>
  • Loading branch information
Chris Manghane authored and ianlancetaylor committed Jul 31, 2015
1 parent bc4dda1 commit 2bf7c64
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion go/expressions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8499,7 +8499,8 @@ Call_expression::do_lower(Gogo* gogo, Named_object* function,
{
if (!this->fn_->type()->is_error())
this->report_error(_("expected function"));
return Expression::make_error(loc);
this->set_is_error();
return this;
}

// Handle an argument which is a call to a function which returns
Expand Down

0 comments on commit 2bf7c64

Please sign in to comment.