aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4argumentsobject.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@theqtcompany.com>2014-12-15 08:46:38 +0100
committerSimon Hausmann <simon.hausmann@digia.com>2014-12-20 12:00:39 +0100
commit74c658bb631fd5bab433b9867ff2e568a56ec082 (patch)
treecf82000446c51064a2f8643fd5ffd74b0bcca668 /src/qml/jsruntime/qv4argumentsobject.cpp
parent965fac4418bec7e7b3c84efd76f7803116fb9eac (diff)
Make Property uses GC safe
Change-Id: I5aa41a07a2d25e5c8a2d64bfa58a55fcd7aaf77e Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4argumentsobject.cpp')
-rw-r--r--src/qml/jsruntime/qv4argumentsobject.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/qml/jsruntime/qv4argumentsobject.cpp b/src/qml/jsruntime/qv4argumentsobject.cpp
index d9e6caf5ab..f0898088e2 100644
--- a/src/qml/jsruntime/qv4argumentsobject.cpp
+++ b/src/qml/jsruntime/qv4argumentsobject.cpp
@@ -88,7 +88,7 @@ void ArgumentsObject::fullyCreate()
d()->mappedArguments = md->reallocate(engine(), d()->mappedArguments, numAccessors);
for (uint i = 0; i < (uint)numAccessors; ++i) {
mappedArguments()->data[i] = context()->callData->args[i];
- arraySet(i, context()->engine->argumentsAccessors[i], Attr_Accessor);
+ arraySet(i, context()->engine->argumentsAccessors + i, Attr_Accessor);
}
arrayPut(numAccessors, context()->callData->args + numAccessors, argCount - numAccessors);
for (uint i = numAccessors; i < argCount; ++i)
@@ -97,13 +97,13 @@ void ArgumentsObject::fullyCreate()
d()->fullyCreated = true;
}
-bool ArgumentsObject::defineOwnProperty(ExecutionEngine *engine, uint index, const Property &desc, PropertyAttributes attrs)
+bool ArgumentsObject::defineOwnProperty(ExecutionEngine *engine, uint index, const Property *desc, PropertyAttributes attrs)
{
fullyCreate();
Scope scope(engine);
Property *pd = arrayData() ? arrayData()->getProperty(index) : 0;
- Property map;
+ ScopedProperty map(scope);
PropertyAttributes mapAttrs;
bool isMapped = false;
uint numAccessors = qMin((int)context()->function->formalParameterCount(), context()->realArgumentCount);
@@ -114,7 +114,7 @@ bool ArgumentsObject::defineOwnProperty(ExecutionEngine *engine, uint index, con
if (isMapped) {
Q_ASSERT(arrayData());
mapAttrs = arrayData()->attributes(index);
- map.copy(*pd, mapAttrs);
+ map->copy(pd, mapAttrs);
setArrayAttributes(index, Attr_Data);
pd = arrayData()->getProperty(index);
pd->value = mappedArguments()->data[index];
@@ -127,10 +127,10 @@ bool ArgumentsObject::defineOwnProperty(ExecutionEngine *engine, uint index, con
if (isMapped && attrs.isData()) {
Q_ASSERT(arrayData());
- ScopedFunctionObject setter(scope, map.setter());
+ ScopedFunctionObject setter(scope, map->setter());
ScopedCallData callData(scope, 1);
callData->thisObject = this->asReturnedValue();
- callData->args[0] = desc.value;
+ callData->args[0] = desc->value;
setter->call(callData);
if (attrs.isWritable()) {