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

Submitted by Ian Taylor on Dec. 16, 2010, 12:02 a.m.

Details

Message ID mcrr5dizisj.fsf@google.com
State New
Headers show

Commit Message

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 hide | download patch | download mbox

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;