From ef90db10a8c943d4684a98035465e92327513130 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Mon, 5 Dec 2016 14:22:04 +0100 Subject: [PATCH] Fix the init() function in Heap::FunctionObject One of the overloads took a QV4::Function * and was so far apparently unused (as it couldn't have worked since change 3b14e2ffdd8eb4b7f7f4508768b75f2acc399370). Fix it since it's getting some use again in the next change. Change-Id: I3eabb332f9e3f2262a5710d43016346b7138f7e7 Reviewed-by: Simon Hausmann --- src/qml/jsruntime/qv4functionobject.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qml/jsruntime/qv4functionobject.cpp b/src/qml/jsruntime/qv4functionobject.cpp index 5bbe2d5f9a..93f707392c 100644 --- a/src/qml/jsruntime/qv4functionobject.cpp +++ b/src/qml/jsruntime/qv4functionobject.cpp @@ -81,7 +81,8 @@ void Heap::FunctionObject::init(QV4::ExecutionContext *scope, QV4::String *name, void Heap::FunctionObject::init(QV4::ExecutionContext *scope, Function *function, bool createProto) { Object::init(); - function = nullptr; + this->function = function; + function->compilationUnit->addref(); this->scope = scope->d(); Scope s(scope->engine()); ScopedString name(s, function->name());