Changeset 225851 in webkit
- Timestamp:
- Dec 13, 2017 10:20:53 AM (6 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r225845 r225851 1 2017-12-13 Caio Lima <ticaiolima@gmail.com> 2 3 [ESNext][BigInt] Breking tests on Debug build and 32-bits due to missing Exception check 4 https://bugs.webkit.org/show_bug.cgi?id=180746 5 6 Reviewed by Saam Barati. 7 8 We have some uncatched exceptions that could happen due to OOM into 9 JSBigInt::allocateFor and JSBigInt::toStringGeneric. This patching is 10 catching such exceptions properly. 11 12 * runtime/JSBigInt.cpp: 13 (JSC::JSBigInt::allocateFor): 14 (JSC::JSBigInt::parseInt): 15 * runtime/JSCJSValue.cpp: 16 (JSC::JSValue::toStringSlowCase const): 17 1 18 2017-12-13 Saam Barati <sbarati@apple.com> 2 19 -
trunk/Source/JavaScriptCore/runtime/JSBigInt.cpp
r225799 r225851 48 48 #include "JSBigInt.h" 49 49 50 #include "CatchScope.h" 50 51 #include "JSCInlines.h" 51 52 #include "MathCommon.h" … … 579 580 ASSERT(charcount >= 0); 580 581 581 auto scope = DECLARE_THROW_SCOPE(vm);582 583 582 size_t bitsPerChar = maxBitsPerCharTable[radix]; 584 583 size_t chars = charcount; … … 599 598 } 600 599 601 if (state) 600 if (state) { 601 auto scope = DECLARE_THROW_SCOPE(vm); 602 602 throwOutOfMemoryError(state, scope); 603 } 603 604 return nullptr; 604 605 } … … 656 657 int limitA = 'A' + (radix - 10); 657 658 659 auto scope = DECLARE_CATCH_SCOPE(vm); 658 660 JSBigInt* result = allocateFor(state, vm, radix, length - p); 659 if (!result) 660 return nullptr; 661 RETURN_IF_EXCEPTION(scope, nullptr); 661 662 662 663 result->initialize(InitializationType::WithZero); -
trunk/Source/JavaScriptCore/runtime/JSCJSValue.cpp
r225799 r225851 384 384 if (auto digit = bigInt->singleDigitValueForString()) 385 385 return vm.smallStrings.singleCharacterString(*digit + '0'); 386 return jsNontrivialString(&vm, bigInt->toString(*exec, 10)); 386 JSString* returnString = jsNontrivialString(&vm, bigInt->toString(*exec, 10)); 387 RETURN_IF_EXCEPTION(scope, errorValue()); 388 return returnString; 387 389 } 388 390
Note: See TracChangeset
for help on using the changeset viewer.