Commit a16ecd9e authored by Jakob Kummerow's avatar Jakob Kummerow Committed by Commit Bot

[bigint] Require --harmony-bigint for deserialization

While deserializing a BigInt with the --harmony-bigint flag off is
harmless in itself, trying to wrap one as an Object (either during
deserialization of a JSValue or later from user code) requires the
BigInt constructor to be available. Since there's no strong reason
to support deserialization of BigInts without the flag, this patch
simply disallows it, which fixes the problem.

Bug: chromium:820819
Change-Id: I024a4f13715bbe95ee8eb6e1710e8f47ca227644
Reviewed-on: https://chromium-review.googlesource.com/959802Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51911}
parent 1a77a9f4
......@@ -1255,6 +1255,7 @@ MaybeHandle<String> ValueDeserializer::ReadString() {
}
MaybeHandle<BigInt> ValueDeserializer::ReadBigInt() {
if (!FLAG_harmony_bigint) return MaybeHandle<BigInt>();
uint32_t bitfield;
if (!ReadVarint<uint32_t>().To(&bitfield)) return MaybeHandle<BigInt>();
int bytelength = BigInt::DigitsByteLengthForBitfield(bitfield);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment