Fix regression in handling of arguments objects
authorLars Knoll <lars.knoll@theqtcompany.com>
Tue, 11 Nov 2014 17:47:17 +0000 (18:47 +0100)
committerSimon Hausmann <simon.hausmann@digia.com>
Wed, 12 Nov 2014 11:12:57 +0000 (12:12 +0100)
Make sure the mappedArguments object gets properly created and is
large enough before using it.

Change-Id: Icb3c937483b49a7856d8d075d53fc10a11044840
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
src/qml/jsruntime/qv4argumentsobject.cpp

index 5899fed..253587a 100644 (file)
@@ -83,7 +83,7 @@ void ArgumentsObject::fullyCreate()
 
     Scope scope(engine());
     Scoped<MemberData> md(scope, d()->mappedArguments);
-    if (md)
+    if (!md || md->size() < numAccessors)
         d()->mappedArguments = md->reallocate(engine(), d()->mappedArguments, numAccessors);
     for (uint i = 0; i < (uint)numAccessors; ++i) {
         mappedArguments()->data[i] = context()->d()->callData->args[i];