A few of the Gogo data fields were not being initialized correctly,
causing Valgrind failures and possible confusion.  This patch by Than
McIntosh fixes the problem.  Bootstrapped and ran Go testsuite on
x86_64-pc-linux-gnu.  Committed to mainline.

Ian
Index: gcc/go/gofrontend/go.cc
===================================================================
--- gcc/go/gofrontend/go.cc     (revision 245745)
+++ gcc/go/gofrontend/go.cc     (working copy)
@@ -34,10 +34,8 @@ go_create_gogo(const struct go_create_go
 
   if (args->relative_import_path != NULL)
     ::gogo->set_relative_import_path(args->relative_import_path);
-  if (args->check_divide_by_zero)
-    ::gogo->set_check_divide_by_zero(args->check_divide_by_zero);
-  if (args->check_divide_overflow)
-    ::gogo->set_check_divide_overflow(args->check_divide_overflow);
+  ::gogo->set_check_divide_by_zero(args->check_divide_by_zero);
+  ::gogo->set_check_divide_overflow(args->check_divide_overflow);
   if (args->compiling_runtime)
     ::gogo->set_compiling_runtime(args->compiling_runtime);
   if (args->c_header != NULL)
Index: gcc/go/gofrontend/gogo.cc
===================================================================
--- gcc/go/gofrontend/gogo.cc   (revision 245745)
+++ gcc/go/gofrontend/gogo.cc   (working copy)
@@ -50,6 +50,11 @@ Gogo::Gogo(Backend* backend, Linemap* li
     pkgpath_from_option_(false),
     prefix_from_option_(false),
     relative_import_path_(),
+    c_header_(),
+    check_divide_by_zero_(true),
+    check_divide_overflow_(true),
+    compiling_runtime_(false),
+    debug_escape_level_(0),
     verify_types_(),
     interface_types_(),
     specific_type_functions_(),

Reply via email to