aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2014-12-02 12:46:20 +0100
committerSimon Hausmann <simon.hausmann@digia.com>2014-12-20 10:07:39 +0100
commita8efa705ac21ec020474b9dcc8ab454ddedad037 (patch)
treebcd2ac0ddee28fb48cde2ccba13467864db33711
parentf2253e6b59e3e8a5d8524b766c03ce79389a4870 (diff)
Fix Context::getPropertyAndBase to use Heap based objects
Change-Id: I4f885a8af5e963445959871b7f26f3bcb3dfa654 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
-rw-r--r--src/qml/jsruntime/qv4context.cpp8
-rw-r--r--src/qml/jsruntime/qv4context_p.h2
-rw-r--r--src/qml/jsruntime/qv4runtime.cpp4
3 files changed, 6 insertions, 8 deletions
diff --git a/src/qml/jsruntime/qv4context.cpp b/src/qml/jsruntime/qv4context.cpp
index 3c36612222..001a586050 100644
--- a/src/qml/jsruntime/qv4context.cpp
+++ b/src/qml/jsruntime/qv4context.cpp
@@ -404,11 +404,11 @@ ReturnedValue ExecutionContext::getProperty(String *name)
return engine()->throwReferenceError(n);
}
-ReturnedValue ExecutionContext::getPropertyAndBase(String *name, Object *&base)
+ReturnedValue ExecutionContext::getPropertyAndBase(String *name, Heap::Object **base)
{
Scope scope(this);
ScopedValue v(scope);
- base = (Object *)0;
+ *base = (Heap::Object *)0;
name->makeIdentifier();
if (name->equals(d()->engine->id_this))
@@ -424,7 +424,7 @@ ReturnedValue ExecutionContext::getPropertyAndBase(String *name, Object *&base)
bool hasProperty = false;
v = w->get(name, &hasProperty);
if (hasProperty) {
- base = w;
+ *base = w->d();
return v.asReturnedValue();
}
continue;
@@ -454,7 +454,7 @@ ReturnedValue ExecutionContext::getPropertyAndBase(String *name, Object *&base)
v = activation->get(name, &hasProperty);
if (hasProperty) {
if (ctx->d()->type == Heap::ExecutionContext::Type_QmlContext)
- base = activation;
+ *base = activation->d();
return v.asReturnedValue();
}
}
diff --git a/src/qml/jsruntime/qv4context_p.h b/src/qml/jsruntime/qv4context_p.h
index 39456b202f..7876c3ae16 100644
--- a/src/qml/jsruntime/qv4context_p.h
+++ b/src/qml/jsruntime/qv4context_p.h
@@ -149,7 +149,7 @@ struct Q_QML_EXPORT ExecutionContext : public Managed
void setProperty(String *name, const ValueRef value);
ReturnedValue getProperty(String *name);
- ReturnedValue getPropertyAndBase(String *name, Object *&base);
+ ReturnedValue getPropertyAndBase(String *name, Heap::Object **base);
bool deleteProperty(String *name);
inline CallContext *asCallContext();
diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp
index c4c0fd416c..9b8912fecb 100644
--- a/src/qml/jsruntime/qv4runtime.cpp
+++ b/src/qml/jsruntime/qv4runtime.cpp
@@ -924,10 +924,8 @@ ReturnedValue Runtime::callActivationProperty(ExecutionEngine *engine, int nameI
ScopedString name(scope, engine->currentContext()->compilationUnit->runtimeStrings[nameIndex]);
ScopedObject base(scope);
- Object *baseObj = 0;
ScopedContext ctx(scope, engine->currentContext());
- ScopedValue func(scope, ctx->getPropertyAndBase(name, baseObj));
- base.ptr->m = baseObj ? &baseObj->data : 0;
+ ScopedValue func(scope, ctx->getPropertyAndBase(name, base.getRef()));
if (scope.engine->hasException)
return Encode::undefined();