Skip to content

Commit 6f10652

Browse files
committed
Fix unverified exception in JSONPPathEntryTypeCall
https://bugs.webkit.org/show_bug.cgi?id=243674 rdar://98326554 Reviewed by Alexey Shvayka. Since hasProperty might throw an exception, we need to handle the exception in both branches before proceeding. * Source/JavaScriptCore/interpreter/Interpreter.cpp: (JSC::Interpreter::executeProgram): Canonical link: https://commits.webkit.org/253233@main
1 parent bde1a7d commit 6f10652

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Source/JavaScriptCore/interpreter/Interpreter.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -902,8 +902,9 @@ JSValue Interpreter::executeProgram(const SourceCode& source, JSGlobalObject*, J
902902
if (JSONPPath.size() == 1 && JSONPPath.last().m_type != JSONPPathEntryTypeLookup) {
903903
RELEASE_ASSERT(baseObject == globalObject);
904904
JSGlobalLexicalEnvironment* scope = globalObject->globalLexicalEnvironment();
905-
if (scope->hasProperty(globalObject, ident)) {
906-
RETURN_IF_EXCEPTION(throwScope, JSValue());
905+
bool hasProperty = scope->hasProperty(globalObject, ident);
906+
RETURN_IF_EXCEPTION(throwScope, JSValue());
907+
if (hasProperty) {
907908
PropertySlot slot(scope, PropertySlot::InternalMethodType::Get);
908909
JSGlobalLexicalEnvironment::getOwnPropertySlot(scope, globalObject, ident, slot);
909910
if (slot.getValue(globalObject, ident) == jsTDZValue())

0 commit comments

Comments
 (0)