• Jakob Kummerow's avatar
    [bigint] Fix NoSideEffectsToString for 32-bit platforms · 9d493179
    Jakob Kummerow authored
    On 32-bit platforms, String::kMaxLength is such that not all BigInts
    can be converted to Strings. NoSideEffectsToString, however, used to
    assume that this conversion always succeeds. This patch adds a check
    for the failure case, and returns "<a very large BigInt>" instead of
    crashing.
    This change is practically unobservable, because actually formatting
    such a huge BigInt to String would take "forever", which is also why
    there is no regression test.
    
    Bug: chromium:876628
    Change-Id: I1eacdc1cce753ac5d9ca66e61e479043ab576e07
    Reviewed-on: https://chromium-review.googlesource.com/1194004Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
    Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#55491}
    9d493179
bigint.cc 99.2 KB