When the print builtins are called with no arguments, the compiler
issues a warning and crashes when trying to produce the backend
representation for the arguments.
Fixes golang/go#11526.
Reviewed-on: https://go-review.googlesource.com/13131
From-SVN: r227039
-ec34cfb0b148ff461df12c8f5270a06e2f438b7c
+cc7303c97b232ea979cab950d95aaf76c4e0f5b5
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
location);
}
+ // There aren't any arguments to the print builtin. The compiler
+ // issues a warning for this so we should avoid getting the backend
+ // representation for this call. Instead, perform a no-op.
+ if (print_stmts == NULL)
+ return context->backend()->boolean_constant_expression(false);
+
return print_stmts->get_backend(context);
}