aboutsummaryrefslogtreecommitdiff
path: root/gcc/go/gofrontend
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2022-06-24 17:18:15 -0700
committerIan Lance Taylor <iant@golang.org>2022-06-27 09:50:39 -0700
commit722750a44a93ce7d23e09df240d8ab700a2d30e6 (patch)
treee5b4f6cee5028f3a2f5672f16b42a9080420954f /gcc/go/gofrontend
parenta1f8a3860fe5c83a023688c29636b5abe03db949 (diff)
downloadgcc-722750a44a93ce7d23e09df240d8ab700a2d30e6.zip
gcc-722750a44a93ce7d23e09df240d8ab700a2d30e6.tar.gz
gcc-722750a44a93ce7d23e09df240d8ab700a2d30e6.tar.bz2
compiler: always initialize mpfr in integer import
Test case is https://go.dev/cl/413980. Fixes golang/go#52862 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/413981
Diffstat (limited to 'gcc/go/gofrontend')
-rw-r--r--gcc/go/gofrontend/MERGE2
-rw-r--r--gcc/go/gofrontend/expressions.cc2
2 files changed, 2 insertions, 2 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE
index e20212e..f84347e 100644
--- a/gcc/go/gofrontend/MERGE
+++ b/gcc/go/gofrontend/MERGE
@@ -1,4 +1,4 @@
-6a7ba754e5d98efe0875f1f41f40098e976e7958
+6edae0ef6521569e8f949aaaafa9dc1139825051
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc
index 734ecb9..135dae02 100644
--- a/gcc/go/gofrontend/expressions.cc
+++ b/gcc/go/gofrontend/expressions.cc
@@ -2715,7 +2715,7 @@ Integer_expression::do_import(Import_expression* imp, Location loc)
return Expression::make_error(loc);
}
if (pos == std::string::npos)
- mpfr_set_ui(real, 0, MPFR_RNDN);
+ mpfr_init_set_ui(real, 0, MPFR_RNDN);
else
{
std::string real_str = num.substr(0, pos);