Patchwork Go patch committed: Fix another crash with Sizeof of undefined type

login
register
mail settings
Submitter Ian Taylor
Date Dec. 16, 2010, 12:02 a.m.
Message ID <mcrr5dizisj.fsf@google.com>
Download mbox | patch
Permalink /patch/75706/
State New
Headers show

Comments

Ian Taylor - Dec. 16, 2010, 12:02 a.m.
This patch to the Go frontend fixes a different crash which occurs when
using Sizeof on an undefined type.  Bootstrapped and tested on
x86_64-unknown-linux-gnu.  Committed to mainline.

Ian

Patch

diff -r cd8e1c7365a0 go/expressions.cc
--- a/go/expressions.cc	Wed Dec 15 15:56:00 2010 -0800
+++ b/go/expressions.cc	Wed Dec 15 15:58:33 2010 -0800
@@ -7069,7 +7069,8 @@ 
       return false;
     }
   if (args->front()->is_error_expression()
-      || args->front()->type()->is_error_type())
+      || args->front()->type()->is_error_type()
+      || args->front()->type()->is_undefined())
     {
       this->set_is_error();
       return false;