Patchwork Go patch committed: Don't crash adding multiple value function calls

login
register
mail settings
Submitter Ian Taylor
Date Jan. 4, 2011, 10:37 p.m.
Message ID <mcrpqscnvmg.fsf@google.com>
Download mbox | patch
Permalink /patch/77543/
State New
Headers show

Comments

Ian Taylor - Jan. 4, 2011, 10:37 p.m.
This patch to the Go frontend avoids a crash when doing a binary
operation on two function calls which return multiple results.
Bootstrapped and tested on x86_64-unknown-linux-gnu.  Committed to
mainline.

Ian

Patch

diff -r 038b6ab8c6a5 go/types.cc
--- a/go/types.cc	Tue Jan 04 14:17:55 2011 -0800
+++ b/go/types.cc	Tue Jan 04 14:34:43 2011 -0800
@@ -401,6 +401,11 @@ 
       return t1->interface_type()->is_identical(t2->interface_type(),
 						errors_are_identical);
 
+    case TYPE_CALL_MULTIPLE_RESULT:
+      if (reason != NULL)
+	*reason = "invalid use of multiple value function call";
+      return false;
+
     default:
       gcc_unreachable();
     }