Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(252)

Issue 2987003002: [corelib] Add explicit overflow checks to int.parse (Closed)

Created:
3 years, 4 months ago by alexmarkov
Modified:
3 years, 4 months ago
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

[corelib] Add explicit overflow checks to int.parse In the --limit-ints-to-64-bits mode, when Dart integers are limited to 64 bits, int.parse() should detect and reject large integers. This CL adds explicit overflow checks into int.parse() implementation. R=lrn@google.com, zra@google.com Issue: https://github.com/dart-lang/sdk/issues/30103 Committed: https://github.com/dart-lang/sdk/commit/b64014c624ea51a0cf194c3d29fd7d16cd0a8cd6

Patch Set 1 #

Total comments: 15

Patch Set 2 : Table of overflow limits is filled lazily, limit for smi is also cached #

Patch Set 3 : Copyright year corrected #

Patch Set 4 : Comments in Dart are converted to doc-comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+141 lines, -0 lines) Patch
M runtime/lib/integers_patch.dart View 1 2 3 2 chunks +57 lines, -0 lines 0 comments Download
M tests/corelib_2/corelib_2.status View 2 chunks +2 lines, -0 lines 0 comments Download
A tests/corelib_2/int_parse_with_limited_ints_test.dart View 1 2 1 chunk +82 lines, -0 lines 0 comments Download

Messages

Total messages: 11 (2 generated)
alexmarkov
3 years, 4 months ago (2017-07-27 21:01:08 UTC) #2
zra
https://codereview.chromium.org/2987003002/diff/1/runtime/lib/integers_patch.dart File runtime/lib/integers_patch.dart (right): https://codereview.chromium.org/2987003002/diff/1/runtime/lib/integers_patch.dart#newcode239 runtime/lib/integers_patch.dart:239: static const _int64OverflowLimits = const [ Is there any ...
3 years, 4 months ago (2017-07-27 21:22:38 UTC) #3
alexmarkov
https://codereview.chromium.org/2987003002/diff/1/runtime/lib/integers_patch.dart File runtime/lib/integers_patch.dart (right): https://codereview.chromium.org/2987003002/diff/1/runtime/lib/integers_patch.dart#newcode239 runtime/lib/integers_patch.dart:239: static const _int64OverflowLimits = const [ On 2017/07/27 21:22:38, ...
3 years, 4 months ago (2017-07-27 23:37:33 UTC) #4
Lasse Reichstein Nielsen
lgtm https://codereview.chromium.org/2987003002/diff/1/runtime/lib/integers_patch.dart File runtime/lib/integers_patch.dart (right): https://codereview.chromium.org/2987003002/diff/1/runtime/lib/integers_patch.dart#newcode136 runtime/lib/integers_patch.dart:136: int negativeOverflowLimit = _int64OverflowLimits[tableIndex + 1]; Only read ...
3 years, 4 months ago (2017-07-27 23:40:18 UTC) #5
alexmarkov
Thank you for the review. Please take a look at the new version without large ...
3 years, 4 months ago (2017-07-28 17:29:02 UTC) #6
alexmarkov
https://codereview.chromium.org/2987003002/diff/1/runtime/lib/integers_patch.dart File runtime/lib/integers_patch.dart (right): https://codereview.chromium.org/2987003002/diff/1/runtime/lib/integers_patch.dart#newcode153 runtime/lib/integers_patch.dart:153: } On 2017/07/28 17:29:02, alexmarkov wrote: > On 2017/07/27 ...
3 years, 4 months ago (2017-07-28 18:25:56 UTC) #7
zra
lgtm lgtm
3 years, 4 months ago (2017-07-28 19:25:12 UTC) #8
zra
lgtm
3 years, 4 months ago (2017-07-28 19:25:12 UTC) #9
alexmarkov
3 years, 4 months ago (2017-07-31 15:31:52 UTC) #11
Message was sent while issue was closed.
Committed patchset #4 (id:60001) manually as
b64014c624ea51a0cf194c3d29fd7d16cd0a8cd6 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698