Ignore:
Timestamp:
Aug 13, 2013, 10:49:52 AM (12 years ago)
Author:
[email protected]
Message:

Harden executeConstruct against incorrect return types from host functions
https://bugs.webkit.org/show_bug.cgi?id=119757

Reviewed by Mark Hahnenberg.

Add logic to guard against bogus return types. There doesn't seem to be any
class in webkit that does this wrong, but the typed array stubs in debug JSC
do exhibit this bad behaviour.

  • interpreter/Interpreter.cpp:

(JSC::Interpreter::executeConstruct):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp

    r153679 r154011  
    10051005            result = constructData.js.functionExecutable->generatedJITCodeForConstruct()->execute(&m_stack, newCallFrame, &vm);
    10061006#endif // ENABLE(JIT)
    1007         } else
     1007        } else {
    10081008            result = JSValue::decode(constructData.native.function(newCallFrame));
     1009            if (!callFrame->hadException()) {
     1010                ASSERT_WITH_MESSAGE(result.isObject(), "Host constructor returned non object.");
     1011                if (!result.isObject())
     1012                    throwTypeError(newCallFrame);
     1013            }
     1014        }
    10091015    }
    10101016
Note: See TracChangeset for help on using the changeset viewer.