Bug 1328834 - Check hasScript in IonBuilder::createThisScriptedSingleton. r=h4writer
authorJan de Mooij <jdemooij@mozilla.com>
Tue, 10 Jan 2017 11:52:59 +0100
changeset 328757 5a2e4e4e4f0e65c17f10658dc1f7ee67ff515b74
parent 328756 b93a1c921f66bd42dac9f2c31f0971ba9dc993d4
child 328758 06a71c58934a2f5b2dc45f4d2eca33fce78a82fd
push id31187
push userkwierso@gmail.com
push dateWed, 11 Jan 2017 01:56:54 +0000
treeherdermozilla-central@b079c9833e3e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersh4writer
bugs1328834
milestone53.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1328834 - Check hasScript in IonBuilder::createThisScriptedSingleton. r=h4writer
js/src/jit/IonBuilder.cpp
--- a/js/src/jit/IonBuilder.cpp
+++ b/js/src/jit/IonBuilder.cpp
@@ -4724,16 +4724,19 @@ IonBuilder::getSingletonPrototype(JSFunc
     HeapTypeSetKey protoProperty = targetKey->property(protoid);
 
     return protoProperty.singleton(constraints());
 }
 
 MDefinition*
 IonBuilder::createThisScriptedSingleton(JSFunction* target, MDefinition* callee)
 {
+    if (!target->hasScript())
+        return nullptr;
+
     // Get the singleton prototype (if exists)
     JSObject* proto = getSingletonPrototype(target);
     if (!proto)
         return nullptr;
 
     JSObject* templateObject = inspector->getTemplateObject(pc);
     if (!templateObject)
         return nullptr;