commit | 6edae0ef6521569e8f949aaaafa9dc1139825051 | [log] [tgz] |
---|---|---|
author | Ian Lance Taylor <iant@golang.org> | Fri Jun 24 17:18:15 2022 -0700 |
committer | Ian Lance Taylor <iant@golang.org> | Mon Jun 27 16:50:17 2022 +0000 |
tree | 9ca76764e540fc6c8333ce4c826825f98a1aafe3 | |
parent | 6a7ba754e5d98efe0875f1f41f40098e976e7958 [diff] |
compiler: always initialize mpfr in integer import Test case is https://go.dev/cl/413980. Fixes golang/go#52862 Change-Id: I2233878df0ee075a5cc60e32151cc9802e9b7075 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/413981 Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Than McIntosh <thanm@google.com>
diff --git a/go/expressions.cc b/go/expressions.cc index 734ecb9..135dae0 100644 --- a/go/expressions.cc +++ b/go/expressions.cc
@@ -2715,7 +2715,7 @@ 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);