Changeset 209028 in webkit


Ignore:
Timestamp:
Nov 28, 2016 3:14:43 PM (7 years ago)
Author:
mark.lam@apple.com
Message:

Fix exception scope verification failures in JSScope.cpp.
https://bugs.webkit.org/show_bug.cgi?id=165047

Reviewed by Saam Barati.

  • runtime/JSScope.cpp:

(JSC::JSScope::resolve):

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r209027 r209028  
     12016-11-28  Mark Lam  <mark.lam@apple.com>
     2
     3        Fix exception scope verification failures in JSScope.cpp.
     4        https://bugs.webkit.org/show_bug.cgi?id=165047
     5
     6        Reviewed by Saam Barati.
     7
     8        * runtime/JSScope.cpp:
     9        (JSC::JSScope::resolve):
     10
    1112016-11-28  Mark Lam  <mark.lam@apple.com>
    212
  • trunk/Source/JavaScriptCore/runtime/JSScope.cpp

    r208761 r209028  
    2727#include "JSScope.h"
    2828
     29#include "Exception.h"
    2930#include "JSGlobalObject.h"
    3031#include "JSLexicalEnvironment.h"
     
    230231            JSScope* globalScopeExtension = scope->globalObject(vm)->globalScopeExtension();
    231232            if (UNLIKELY(globalScopeExtension)) {
    232                 if (object->hasProperty(exec, ident))
     233                bool hasProperty = object->hasProperty(exec, ident);
     234                RETURN_IF_EXCEPTION(throwScope, nullptr);
     235                if (hasProperty)
    233236                    return object;
    234237                JSObject* extensionScopeObject = JSScope::objectAtScope(globalScopeExtension);
    235                 if (extensionScopeObject->hasProperty(exec, ident))
     238                hasProperty = extensionScopeObject->hasProperty(exec, ident);
     239                RETURN_IF_EXCEPTION(throwScope, nullptr);
     240                if (hasProperty)
    236241                    return extensionScopeObject;
    237242            }
     
    239244        }
    240245
    241         if (object->hasProperty(exec, ident)) {
    242             if (!isUnscopable(exec, scope, object, ident))
     246        bool hasProperty = object->hasProperty(exec, ident);
     247        RETURN_IF_EXCEPTION(throwScope, nullptr);
     248        if (hasProperty) {
     249            bool unscopable = isUnscopable(exec, scope, object, ident);
     250            ASSERT(!throwScope.exception() || !unscopable);
     251            if (!unscopable)
    243252                return object;
    244             ASSERT_WITH_MESSAGE_UNUSED(throwScope, !throwScope.exception(), "When an exception occurs, the result of isUnscopable becomes false");
    245253        }
    246254    }
Note: See TracChangeset for help on using the changeset viewer.