Go patch committed: Mark erroneous builtin calls as erroneous
Ian Lance Taylor
iant@golang.org
Tue Mar 31 00:11:00 GMT 2015
This patch to the Go frontend marks some builtin calls with erroneous
as erroneous. This avoids a compiler crash on invalid code
(http://golang.org/issue/10285). Bootstrapped and ran Go testsuite on
x86_64-unknown-linux-gnu. Committed to mainline.
Ian
-------------- next part --------------
diff -r 6780bf5a7069 go/expressions.cc
--- a/go/expressions.cc Mon Mar 30 10:30:44 2015 -0700
+++ b/go/expressions.cc Mon Mar 30 17:07:15 2015 -0700
@@ -7887,7 +7887,10 @@
Type* arg1_type = args->front()->type();
Type* arg2_type = args->back()->type();
if (arg1_type->is_error() || arg2_type->is_error())
- break;
+ {
+ this->set_is_error();
+ break;
+ }
Type* e1;
if (arg1_type->is_slice_type())
@@ -7929,7 +7932,10 @@
}
if (args->front()->type()->is_error()
|| args->back()->type()->is_error())
- break;
+ {
+ this->set_is_error();
+ break;
+ }
Array_type* at = args->front()->type()->array_type();
Type* e = at->element_type();
More information about the Gcc-patches
mailing list