diff mbox

Go patch committed: Don't crash on invalid complex constant comparison

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

Commit Message

Ian Lance Taylor Feb. 11, 2011, 12:19 a.m. UTC
This patch to the Go frontend avoids a crash when a program does an
invalid comparison of complex constants.  Bootstrapped and ran Go
testsuite on x86_64-unknown-linux-gnu.  Committed to mainline.

Ian
diff mbox

Patch

diff -r 954a311caec4 go/expressions.cc
--- a/go/expressions.cc	Thu Feb 10 15:57:34 2011 -0800
+++ b/go/expressions.cc	Thu Feb 10 16:14:33 2011 -0800
@@ -5159,7 +5159,7 @@ 
 	  {
 	    // May be a type error--let it be diagnosed later.
 	  }
-	else if (is_comparison)
+	else if (op == OPERATOR_EQEQ || op == OPERATOR_NOTEQ)
 	  {
 	    bool b = Binary_expression::compare_complex(op,
 							(left_type != NULL