Ignore:
Timestamp:
Nov 21, 2016, 9:19:30 AM (9 years ago)
Author:
[email protected]
Message:

Fix exception scope verification failures in *Executable.cpp files.
https://bugs.webkit.org/show_bug.cgi?id=164996

Reviewed by Darin Adler.

  • runtime/DirectEvalExecutable.cpp:

(JSC::DirectEvalExecutable::create):

  • runtime/IndirectEvalExecutable.cpp:

(JSC::IndirectEvalExecutable::create):

  • runtime/ProgramExecutable.cpp:

(JSC::ProgramExecutable::initializeGlobalProperties):

  • runtime/ScriptExecutable.cpp:

(JSC::ScriptExecutable::prepareForExecutionImpl):

File:
1 edited

Legend:

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

    r208309 r208950  
    308308    VM& vm, JSFunction* function, JSScope* scope, CodeSpecializationKind kind, CodeBlock*& resultCodeBlock)
    309309{
     310    auto throwScope = DECLARE_THROW_SCOPE(vm);
    310311    DeferGCForAWhile deferGC(vm.heap);
    311312
    312     if (vm.getAndClearFailNextNewCodeBlock())
    313         return createError(scope->globalObject()->globalExec(), ASCIILiteral("Forced Failure"));
    314 
    315     JSObject* exception = 0;
     313    if (vm.getAndClearFailNextNewCodeBlock()) {
     314        auto& state = *scope->globalObject()->globalExec();
     315        return throwException(&state, throwScope, createError(&state, ASCIILiteral("Forced Failure")));
     316    }
     317
     318    JSObject* exception = nullptr;
    316319    CodeBlock* codeBlock = newCodeBlockFor(kind, function, scope, exception);
    317320    resultCodeBlock = codeBlock;
    318     if (!codeBlock) {
    319         RELEASE_ASSERT(exception);
     321    ASSERT(!!throwScope.exception() == !codeBlock);
     322    if (UNLIKELY(!codeBlock))
    320323        return exception;
    321     }
    322324   
    323325    if (Options::validateBytecode())
Note: See TracChangeset for help on using the changeset viewer.