This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Go patch committed: Don't crash on Sizeof of undefined type
- From: Ian Lance Taylor <iant at google dot com>
- To: gcc-patches at gcc dot gnu dot org, gofrontend-dev at googlegroups dot com
- Date: Wed, 15 Dec 2010 15:56:54 -0800
- Subject: Go patch committed: Don't crash on Sizeof of undefined type
This patch to the Go frontend avoids a crash when calling unsafe.Sizeof
on an undefined type. Bootstrapped and ran Go testsuite on
x86_64-unknown-linux-gnu. Committed to mainline.
Ian
diff -r b35342ae6028 go/expressions.cc
--- a/go/expressions.cc Wed Dec 15 15:47:53 2010 -0800
+++ b/go/expressions.cc Wed Dec 15 15:52:50 2010 -0800
@@ -6722,7 +6722,7 @@
if (arg == NULL)
return false;
Type* arg_type = arg->type();
- if (arg_type->is_error_type())
+ if (arg_type->is_error_type() || arg_type->is_undefined())
return false;
if (arg_type->is_abstract())
return false;