Ignore:
Timestamp:
May 30, 2020, 8:01:08 PM (5 years ago)
Author:
[email protected]
Message:

Unreviewed, fix JSC debug tests' exception checking
https://bugs.webkit.org/show_bug.cgi?id=212512

  • runtime/JSBigInt.cpp:

(JSC::JSBigInt::createWithLength):
(JSC::JSBigInt::allocateFor):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/JSBigInt.cpp

    r262342 r262353  
    100100inline JSBigInt* JSBigInt::createWithLength(JSGlobalObject* nullOrGlobalObjectForOOM, VM& vm, unsigned length)
    101101{
    102     auto scope = DECLARE_THROW_SCOPE(vm);
    103102    if (UNLIKELY(length > maxLength)) {
    104         if (nullOrGlobalObjectForOOM)
     103        if (nullOrGlobalObjectForOOM) {
     104            auto scope = DECLARE_THROW_SCOPE(vm);
    105105            throwOutOfMemoryError(nullOrGlobalObjectForOOM, scope, "BigInt generated from this operation is too big"_s);
     106        }
    106107        return nullptr;
    107108    }
     
    110111    void* data = Gigacage::tryMalloc(Gigacage::Primitive, length * sizeof(Digit));
    111112    if (UNLIKELY(!data)) {
    112         if (nullOrGlobalObjectForOOM)
     113        if (nullOrGlobalObjectForOOM) {
     114            auto scope = DECLARE_THROW_SCOPE(vm);
    113115            throwOutOfMemoryError(nullOrGlobalObjectForOOM, scope);
     116        }
    114117        return nullptr;
    115118    }
     
    23332336JSBigInt* JSBigInt::allocateFor(JSGlobalObject* nullOrGlobalObjectForOOM, VM& vm, unsigned radix, unsigned charcount)
    23342337{
    2335     auto scope = DECLARE_THROW_SCOPE(vm);
    2336 
    23372338    ASSERT(2 <= radix && radix <= 36);
    23382339
     
    23492350            unsigned length = (bitsMin + digitBits - 1) / digitBits;
    23502351            if (length <= maxLength)
    2351                 RELEASE_AND_RETURN(scope, createWithLength(nullOrGlobalObjectForOOM, vm, length));
     2352                return createWithLength(nullOrGlobalObjectForOOM, vm, length);
    23522353        }
    23532354    }
    23542355
    2355     if (nullOrGlobalObjectForOOM)
     2356    if (nullOrGlobalObjectForOOM) {
     2357        auto scope = DECLARE_THROW_SCOPE(vm);
    23562358        throwOutOfMemoryError(nullOrGlobalObjectForOOM, scope, "BigInt generated from this operation is too big"_s);
     2359    }
    23572360
    23582361    return nullptr;
     
    25622565            }
    25632566            heapResult = allocateFor(nullOrGlobalObjectForOOM, vm, radix, initialLength);
    2564             if (!heapResult)
     2567            if (UNLIKELY(!heapResult))
    25652568                return JSValue();
    25662569            heapResult->initialize(InitializationType::WithZero);
Note: See TracChangeset for help on using the changeset viewer.