This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Go patch committed: Initialize frame variable


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 -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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]