]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
compiler: always initialize mpfr in integer import
authorIan Lance Taylor <iant@golang.org>
Sat, 25 Jun 2022 00:18:15 +0000 (17:18 -0700)
committerIan Lance Taylor <iant@golang.org>
Mon, 27 Jun 2022 16:50:39 +0000 (09:50 -0700)
Test case is https://go.dev/cl/413980.

Fixes golang/go#52862

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/413981

gcc/go/gofrontend/MERGE
gcc/go/gofrontend/expressions.cc

index e20212e990aa9a254579c98d460e7da4650642cb..f84347ea575892ef5c62bf6b6f4ef2fc72c4e0a9 100644 (file)
@@ -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.
index 734ecb9492e8b269049f7148ba6f2b4cb4d999af..135dae02262d9c5980eae1d73015416e43b3c2ee 100644 (file)
@@ -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);