From 61c08ebc86ecfbb79d95b19a65e63759ee7c1106 Mon Sep 17 00:00:00 2001 From: Christian Holler Date: Mon, 13 Jan 2014 17:03:01 +0100 Subject: [PATCH] Bug 959208 - Handle OOM in CloneObject. r=jandem --HG-- extra : rebase_source : 3832f184a7a0f81efcead90460dfcb95efb90f41 --- js/src/vm/SelfHosting.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/src/vm/SelfHosting.cpp b/js/src/vm/SelfHosting.cpp index 8631f5ec6add..87d876cf5e04 100644 --- a/js/src/vm/SelfHosting.cpp +++ b/js/src/vm/SelfHosting.cpp @@ -891,7 +891,7 @@ CloneObject(JSContext *cx, HandleObject srcObj, CloneMemory &clonedObjects) clone = CloneFunctionObject(cx, fun, cx->global(), kind, TenuredObject); // To be able to re-lazify the cloned function, its name in the // self-hosting compartment has to be stored on the clone. - if (hasName) + if (clone && hasName) clone->as().setExtendedSlot(0, StringValue(fun->atom())); } } else if (srcObj->is()) {