From eade82695ffdf4892ded27c50dccc482df8086a2 Mon Sep 17 00:00:00 2001 From: Fabian Kosmale Date: Fri, 9 Feb 2024 21:38:43 +0100 Subject: Prepare for white allocation during gc (4/9): BoundFunction MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Put the newly created FunctionObject into a Scope. This isn't actually needed, but acts as a safeguard in case FunctionObject::function is changed in the future to allocate memory. Change-Id: I5bcd888cd8bd5cb8c727eb3b29222981c851d4fe Reviewed-by: Sami Shalayel Reviewed-by: Olivier De Cannière Reviewed-by: Ulf Hermann --- src/qml/jsruntime/qv4functionobject.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/qml/jsruntime') diff --git a/src/qml/jsruntime/qv4functionobject.cpp b/src/qml/jsruntime/qv4functionobject.cpp index b4ae7c078a..b5a3934528 100644 --- a/src/qml/jsruntime/qv4functionobject.cpp +++ b/src/qml/jsruntime/qv4functionobject.cpp @@ -428,8 +428,8 @@ ReturnedValue FunctionPrototype::method_bind(const FunctionObject *b, const Valu } ScopedContext ctx(scope, target->scope()); - Heap::BoundFunction *bound = BoundFunction::create(ctx, target, boundThis, boundArgs); - bound->setFunction(target->function()); + Scoped bound(scope, BoundFunction::create(ctx, target, boundThis, boundArgs)); + bound->d()->setFunction(target->function()); return bound->asReturnedValue(); } -- cgit v1.2.3