Fix undefined shift in DiyFpStrtod. (issue 2438383003 by esprehn@chromium.org)

0 views
Skip to first unread message

esp...@chromium.org

unread,
Oct 21, 2016, 7:15:37 PM10/21/16
to jyas...@chromium.org, yu...@chromium.org, blink-...@chromium.org, blink-re...@chromium.org, chromium...@chromium.org, mikhail.p...@intel.com
Reviewers: Jeffrey Yasskin, Yuta Kitamura
CL: https://codereview.chromium.org/2438383003/

Description:
Fix undefined shift in DiyFpStrtod.

This code is just copy pasta from v8, this patch copies a newer version
of the pasta.

https://chromium.googlesource.com/v8/v8/+/374a4da83e6f4e05d31640b23b5ca92f0bbf0586/src/strtod.cc#249

BUG=637044, 629034

Affected files (+1, -1 lines):
M third_party/WebKit/Source/wtf/dtoa/strtod.cc


Index: third_party/WebKit/Source/wtf/dtoa/strtod.cc
diff --git a/third_party/WebKit/Source/wtf/dtoa/strtod.cc b/third_party/WebKit/Source/wtf/dtoa/strtod.cc
index d3b06199e758c67c03a8aad883344b342d43f0d9..998a0c4e912bcb9ab9bce844343c445685271378 100644
--- a/third_party/WebKit/Source/wtf/dtoa/strtod.cc
+++ b/third_party/WebKit/Source/wtf/dtoa/strtod.cc
@@ -264,7 +264,7 @@ namespace double_conversion {
const int kDenominator = 1 << kDenominatorLog;
// Move the remaining decimals into the exponent.
exponent += remaining_decimals;
- int error = (remaining_decimals == 0 ? 0 : kDenominator / 2);
+ int64_t error = (remaining_decimals == 0 ? 0 : kDenominator / 2);

int old_e = input.e();
input.Normalize();


jyas...@chromium.org

unread,
Oct 21, 2016, 7:29:09 PM10/21/16
to esp...@chromium.org, yu...@chromium.org, blink-...@chromium.org, blink-re...@chromium.org, chromium...@chromium.org, mikhail.p...@intel.com

commit-bot@chromium.org via chromiumcodereview-hr.appspot.com

unread,
Oct 21, 2016, 10:21:56 PM10/21/16
to esp...@chromium.org, jyas...@chromium.org, yu...@chromium.org, commi...@chromium.org, blink-...@chromium.org, blink-re...@chromium.org, chromium...@chromium.org, mikhail.p...@intel.com

commit-bot@chromium.org via chromiumcodereview-hr.appspot.com

unread,
Oct 22, 2016, 12:47:55 AM10/22/16
to esp...@chromium.org, jyas...@chromium.org, yu...@chromium.org, commi...@chromium.org, blink-...@chromium.org, blink-re...@chromium.org, chromium...@chromium.org, mikhail.p...@intel.com
Committed patchset #1 (id:1)

https://codereview.chromium.org/2438383003/

commit-bot@chromium.org via chromiumcodereview-hr.appspot.com

unread,
Oct 22, 2016, 12:57:19 AM10/22/16
to esp...@chromium.org, jyas...@chromium.org, yu...@chromium.org, commi...@chromium.org, blink-...@chromium.org, blink-re...@chromium.org, chromium...@chromium.org, mikhail.p...@intel.com
Patchset 1 (id:??) landed as
https://crrev.com/d74c8d750deee3b9412b978b1dc49e2d3f0d75d6
Cr-Commit-Position: refs/heads/master@{#426973}

https://codereview.chromium.org/2438383003/
Reply all
Reply to author
Forward
0 new messages