Fix comparisons between Object pointers
authorLars Knoll <lars.knoll@digia.com>
Tue, 2 Dec 2014 11:23:49 +0000 (12:23 +0100)
committerSimon Hausmann <simon.hausmann@digia.com>
Sat, 20 Dec 2014 09:07:18 +0000 (10:07 +0100)
Change-Id: Icedbe32984b5b8bcb807411aa9945436b4bffca9
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
src/qml/jsruntime/qv4argumentsobject.cpp
src/qml/jsruntime/qv4objectiterator.cpp

index eaca874..f749335 100644 (file)
@@ -108,7 +108,8 @@ bool ArgumentsObject::defineOwnProperty(ExecutionEngine *engine, uint index, con
     bool isMapped = false;
     uint numAccessors = qMin((int)context()->function->formalParameterCount(), context()->realArgumentCount);
     if (pd && index < (uint)numAccessors)
-        isMapped = arrayData()->attributes(index).isAccessor() && pd->getter() == context()->engine->argumentsAccessors[index].getter();
+        isMapped = arrayData()->attributes(index).isAccessor() &&
+                pd->getter()->d() == context()->engine->argumentsAccessors[index].getter()->d();
 
     if (isMapped) {
         Q_ASSERT(arrayData());
index 80b73e5..5c8df40 100644 (file)
@@ -100,11 +100,11 @@ void ObjectIterator::next(Heap::String **name, uint *index, Property *pd, Proper
             if (attrs->isEmpty())
                 break;
             // check the property is not already defined earlier in the proto chain
-            if (current->asObject() != object->asObject()) {
+            if (current->heapObject() != object->heapObject()) {
                 o = object->asObject();
                 n = *name;
                 bool shadowed = false;
-                while (o != current->asObject()) {
+                while (o->asObject()->d() != current->heapObject()) {
                     if ((!!n && o->hasOwnProperty(n)) ||
                         (*index != UINT_MAX && o->hasOwnProperty(*index))) {
                         shadowed = true;
@@ -179,6 +179,7 @@ ReturnedValue ObjectIterator::nextPropertyNameAsString()
         return Encode::null();
 
     PropertyAttributes attrs;
+    // ### GC
     Property p;
     uint index;
     Scope scope(object->engine());
@@ -189,7 +190,7 @@ ReturnedValue ObjectIterator::nextPropertyNameAsString()
 
     if (!!name)
         return name->asReturnedValue();
-    assert(index < UINT_MAX);
+    Q_ASSERT(index < UINT_MAX);
     return Encode(object->engine()->newString(QString::number(index)));
 }