aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2017-03-22 21:02:53 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2017-03-22 21:02:53 +0000
commit36c1cf710de19ec2556fedf49a6ebfa4758e404f (patch)
treed0d24e26e64d8a5688abe09c8cb05f3ac5384a55 /gcc
parent0d3214c2f01c4cc5b74052e4130f2a39d93dc3ef (diff)
downloadgcc-36c1cf710de19ec2556fedf49a6ebfa4758e404f.zip
gcc-36c1cf710de19ec2556fedf49a6ebfa4758e404f.tar.gz
gcc-36c1cf710de19ec2556fedf49a6ebfa4758e404f.tar.bz2
compiler: initialize gogo fields
A couple of the data members in the Gogo class were not being initialized properly. This was causing "uninitialized value" errors during Valgrind memcheck runs. This patch insures that all of the fields receive an initial value. Reviewed-on: https://go-review.googlesource.com/38470 From-SVN: r246407
Diffstat (limited to 'gcc')
-rw-r--r--gcc/go/gofrontend/go.cc6
-rw-r--r--gcc/go/gofrontend/gogo.cc5
2 files changed, 7 insertions, 4 deletions
diff --git a/gcc/go/gofrontend/go.cc b/gcc/go/gofrontend/go.cc
index e0e84e3..7050acc 100644
--- a/gcc/go/gofrontend/go.cc
+++ b/gcc/go/gofrontend/go.cc
@@ -34,10 +34,8 @@ go_create_gogo(const struct go_create_gogo_args* args)
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)
diff --git a/gcc/go/gofrontend/gogo.cc b/gcc/go/gofrontend/gogo.cc
index c5ce5d9..a190917 100644
--- a/gcc/go/gofrontend/gogo.cc
+++ b/gcc/go/gofrontend/gogo.cc
@@ -50,6 +50,11 @@ Gogo::Gogo(Backend* backend, Linemap* linemap, int, int pointer_size)
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_(),