diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2017-04-26 12:49:28 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2017-04-27 06:32:50 +0000 |
commit | 2cb540b4687b198e67c0bc6f176b7e94755ff7fb (patch) | |
tree | 0d64200e59d11b33be58301d213dc8e83d499f56 /src | |
parent | 80dc036882e06763b5202a5966422ba79538a2eb (diff) |
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 <lars.knoll@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/qml/jsruntime/qv4scopedvalue_p.h | 2 |
1 files changed, 1 insertions, 1 deletions
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<CallData *>(scope.alloc(size)); ptr->tag = quint32(QV4::Value::ValueTypeInternal::Integer); ptr->argc = argc; |