Bug 1527155 - Uniformly signal OOM if StringToBigInt result too large r=jwalden,terpri
authorAndy Wingo <wingo@igalia.com>
Tue, 12 Feb 2019 17:05:04 +0000
changeset 458813 9ae214a9c414
parent 458812 44a945b21f87
child 458814 5cbc3f79a126
push id35548
push useropoprus@mozilla.com
push dateWed, 13 Feb 2019 09:48:26 +0000
treeherdermozilla-central@93e37c529818 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwalden, terpri
bugs1527155
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1527155 - Uniformly signal OOM if StringToBigInt result too large r=jwalden,terpri Differential Revision: https://phabricator.services.mozilla.com/D19468
js/src/vm/BigIntType.cpp
--- a/js/src/vm/BigIntType.cpp
+++ b/js/src/vm/BigIntType.cpp
@@ -1381,17 +1381,17 @@ bool BigInt::calculateMaximumDigitsRequi
 
   size_t bitsPerChar = maxBitsPerCharTable[radix];
 
   MOZ_ASSERT(charcount > 0);
   MOZ_ASSERT(charcount <= std::numeric_limits<size_t>::max() / bitsPerChar);
   uint64_t n =
       CeilDiv(charcount * bitsPerChar, DigitBits * bitsPerCharTableMultiplier);
   if (n > MaxDigitLength) {
-    ReportAllocationOverflow(cx);
+    ReportOutOfMemory(cx);
     return false;
   }
 
   *result = n;
   return true;
 }
 
 template <typename CharT>