aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2014-07-17 11:03:08 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2014-07-22 13:49:20 +0200
commit3c53da05229789295cbf75174844c2b3df3db25c (patch)
tree2fcfac8a967e89c5d618ed72d2debfb3c9521d90 /src
parente6f3bcf66e0d154866e96a51b6ab2736ef5e2dc3 (diff)
Fix Scoped(Value) assignment/construction on 32-bit
Make sure to also set the tag value correctly. Change-Id: I3c6589d25b3a20f255581fb4c9248abfe6af3594 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/qml/jsruntime/qv4objectiterator.cpp8
-rw-r--r--src/qml/jsruntime/qv4scopedvalue_p.h12
2 files changed, 20 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4objectiterator.cpp b/src/qml/jsruntime/qv4objectiterator.cpp
index 581380a1fd..216700fe69 100644
--- a/src/qml/jsruntime/qv4objectiterator.cpp
+++ b/src/qml/jsruntime/qv4objectiterator.cpp
@@ -56,6 +56,10 @@ ObjectIterator::ObjectIterator(Value *scratch1, Value *scratch2, Object *o, uint
{
object->o = o;
current->o = o;
+#if QT_POINTER_SIZE == 4
+ object->tag = QV4::Value::Managed_Type;
+ current->tag = QV4::Value::Managed_Type;
+#endif
if (object->as<ArgumentsObject>()) {
Scope scope(object->engine());
@@ -73,6 +77,10 @@ ObjectIterator::ObjectIterator(Scope &scope, Object *o, uint flags)
{
object->o = o;
current->o = o;
+#if QT_POINTER_SIZE == 4
+ object->tag = QV4::Value::Managed_Type;
+ current->tag = QV4::Value::Managed_Type;
+#endif
if (object->as<ArgumentsObject>()) {
Scope scope(object->engine());
diff --git a/src/qml/jsruntime/qv4scopedvalue_p.h b/src/qml/jsruntime/qv4scopedvalue_p.h
index 6045ea5794..563d097440 100644
--- a/src/qml/jsruntime/qv4scopedvalue_p.h
+++ b/src/qml/jsruntime/qv4scopedvalue_p.h
@@ -121,6 +121,9 @@ struct ScopedValue
{
ptr = scope.engine->jsStackTop++;
ptr->m = reinterpret_cast<Managed *>(o);
+#if QT_POINTER_SIZE == 4
+ ptr->tag = QV4::Value::Managed_Type;
+#endif
#ifndef QT_NO_DEBUG
++scope.size;
#endif
@@ -161,6 +164,9 @@ struct ScopedValue
ScopedValue &operator=(HeapObject *o) {
ptr->m = reinterpret_cast<Managed *>(o);
+#if QT_POINTER_SIZE == 4
+ ptr->tag = QV4::Value::Managed_Type;
+#endif
return *this;
}
@@ -233,6 +239,9 @@ struct Scoped
{
Value v;
v.m = reinterpret_cast<Managed *>(o);
+#if QT_POINTER_SIZE == 4
+ v.tag = QV4::Value::Managed_Type;
+#endif
ptr = scope.engine->jsStackTop++;
setPointer(value_cast<T>(v));
#ifndef QT_NO_DEBUG
@@ -307,6 +316,9 @@ struct Scoped
Scoped<T> &operator=(HeapObject *o) {
Value v;
v.m = reinterpret_cast<Managed *>(o);
+#if QT_POINTER_SIZE == 4
+ v.tag = QV4::Value::Managed_Type;
+#endif
setPointer(value_cast<T>(v));
return *this;
}