diff mbox

Go patch committed: Fix crash when tracked field used in global init

Message ID CAOyqgcVwy++6QOiNw4qx-G6=htmFuCmyB+47AoAYY4aXdL_ARQ@mail.gmail.com
State New
Headers show

Commit Message

Ian Lance Taylor Dec. 14, 2014, 7:39 p.m. UTC
My recent patch for tracked fields had a bug that caused a compiler
crash when they were used in a global initializer.  This patch fixes
it.  Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu.
Committed to mainline.

Ian
diff mbox

Patch

diff -r 5f3aca373b7d go/expressions.cc
--- a/go/expressions.cc	Sat Dec 13 16:54:07 2014 -0800
+++ b/go/expressions.cc	Sun Dec 14 11:36:36 2014 -0800
@@ -10731,7 +10731,7 @@ 
     return this;
 
   // References from functions generated by the compiler don't count.
-  if (function->func_value()->is_type_specific_function())
+  if (function != NULL && function->func_value()->is_type_specific_function())
     return this;
 
   // We have found a reference to a tracked field.  Build a call to