Encapsulate and protect all accesses to the vtable of Heap objects
[platform/upstream/qtdeclarative.git] / src / qml / jsruntime / qv4managed_p.h
index e0ad0d8..9b7df9e 100644 (file)
@@ -148,15 +148,15 @@ public:
     };
     Q_MANAGED_TYPE(Invalid)
 
-    bool isListType() const { return d()->vtable->type == Type_QmlSequence; }
+    bool isListType() const { return d()->vtable()->type == Type_QmlSequence; }
 
-    bool isArrayObject() const { return d()->vtable->type == Type_ArrayObject; }
-    bool isStringObject() const { return d()->vtable->type == Type_StringObject; }
+    bool isArrayObject() const { return d()->vtable()->type == Type_ArrayObject; }
+    bool isStringObject() const { return d()->vtable()->type == Type_StringObject; }
 
     QString className() const;
 
     bool isEqualTo(const Managed *other) const
-    { return d()->vtable->isEqualTo(const_cast<Managed *>(this), const_cast<Managed *>(other)); }
+    { return d()->vtable()->isEqualTo(const_cast<Managed *>(this), const_cast<Managed *>(other)); }
 
     static bool isEqualTo(Managed *m, Managed *other);
 
@@ -180,7 +180,7 @@ inline const Managed *Value::as() const {
 
 template<>
 inline const Object *Value::as() const {
-    return isManaged() && m() && m()->vtable->isObject ? objectValue() : 0;
+    return isManaged() && m() && m()->vtable()->isObject ? objectValue() : 0;
 }
 
 }