diff mbox

Go patch committed: Initialize frame variable

Message ID mcr1tshl0dv.fsf@iant-glaptop.roam.corp.google.com
State New
Headers show

Commit Message

Ian Lance Taylor Aug. 16, 2014, 12:54 a.m. UTC
In the change https://codereview.appspot.com/83750044, committed to the
GCC repo in https://gcc.gnu.org/ml/gcc-patches/2014-04/msg00720.html ,
the initialization of the compiler-generated frame variable was
accidentally lost.  When the variable happened to be initialized to a
non-zero value on the stack, this could cause a stack unwind to
terminate early, so that a function that defers a function that recovers
a panic and then panics again might wind up returning when really the
stack unwind should go up to the next higher function that defers a
function that recovers a panic.  This patch fixes the problem.
Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu.
Committed to mainline.

Ian
diff mbox

Patch

diff -r 9fe29170ed7b go/gogo.cc
--- a/go/gogo.cc	Fri Aug 15 15:13:53 2014 -0700
+++ b/go/gogo.cc	Fri Aug 15 17:47:32 2014 -0700
@@ -5176,6 +5176,8 @@ 
               gogo->backend()->init_statement(vars[i], var_inits[i]);
           init.push_back(init_stmt);
 	}
+      if (defer_init != NULL)
+	init.push_back(defer_init);
       Bstatement* var_init = gogo->backend()->statement_list(init);
 
       // Initialize all variables before executing this code block.