Skip to content

Commit

Permalink
compiler: Report init dependency errors with builtin functions.
Browse files Browse the repository at this point in the history
Fixes golang/go#12319.

Change-Id: Ifb7f0bc93a3249a0a309190221ac9e94aad77d95
Reviewed-on: https://go-review.googlesource.com/13931
Reviewed-by: Ian Lance Taylor <iant@golang.org>
  • Loading branch information
Chris Manghane authored and ianlancetaylor committed Sep 15, 2015
1 parent eac8b31 commit 01a574c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions go/expressions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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_)
{
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 01a574c

Please sign in to comment.