From 2cb540b4687b198e67c0bc6f176b7e94755ff7fb Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 26 Apr 2017 12:49:28 +0200 Subject: Fix calling of JS functions with more than 6 parameters from C++ Make sure to allocate enough space on the JS stack to include the calldata members _and_ the parameters when using more than ReservedArgumentCount parameters. Task-number: QTBUG-60396 Change-Id: I7fb2e44550fe081c43b8583f0cd370feb70db159 Reviewed-by: Lars Knoll --- src/qml/jsruntime/qv4scopedvalue_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/qml/jsruntime/qv4scopedvalue_p.h b/src/qml/jsruntime/qv4scopedvalue_p.h index e9dcc9172f..bc882bbd95 100644 --- a/src/qml/jsruntime/qv4scopedvalue_p.h +++ b/src/qml/jsruntime/qv4scopedvalue_p.h @@ -366,7 +366,7 @@ struct Scoped struct ScopedCallData { ScopedCallData(const Scope &scope, int argc = 0) { - int size = qMax(argc, QV4::Global::ReservedArgumentCount + int(offsetof(QV4::CallData, args)/sizeof(QV4::Value))); + int size = int(offsetof(QV4::CallData, args)/sizeof(QV4::Value)) + qMax(argc , int(QV4::Global::ReservedArgumentCount)); ptr = reinterpret_cast(scope.alloc(size)); ptr->tag = quint32(QV4::Value::ValueTypeInternal::Integer); ptr->argc = argc; -- cgit v1.2.3