diff options
author | Erik Verbruggen <erik.verbruggen@qt.io> | 2016-10-12 11:15:09 +0200 |
---|---|---|
committer | Jani Heikkinen <jani.heikkinen@qt.io> | 2016-10-26 08:54:12 +0000 |
commit | c5755267227a81e35052eb447895aa2f1428ebe1 (patch) | |
tree | 66cfe697091a5d45e0ce10eef96421c3a30205e4 /src/qml/jsruntime/qv4value_p.h | |
parent | ba5bd2b87140c4751235619701bb84e993541f82 (diff) |
V4: Fix usage of QV4::Value tags/types
These two were mixed, but have completely different values.
Task-number: QTBUG-56471
(cherry picked from commit 9d2169a2d8b81b8707b20ab892550f4a55c07feb)
Change-Id: I6745521ea4356acdd710285084cce8e965bfc072
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4value_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4value_p.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4value_p.h b/src/qml/jsruntime/qv4value_p.h index d4399b46e4..9eee34aff2 100644 --- a/src/qml/jsruntime/qv4value_p.h +++ b/src/qml/jsruntime/qv4value_p.h @@ -223,6 +223,17 @@ public: setTagValue(Empty_Type_Internal, quint32(i)); } + Q_ALWAYS_INLINE void setEmpty(quint32 i) + { + setTagValue(Empty_Type_Internal, i); + } + + Q_ALWAYS_INLINE quint32 emptyValue() + { + Q_ASSERT(isEmpty()); + return quint32(value()); + } + enum Type { Undefined_Type, Managed_Type, @@ -527,6 +538,7 @@ ReturnedValue Heap::Base::asReturnedValue() const struct Q_QML_PRIVATE_EXPORT Primitive : public Value { inline static Primitive emptyValue(); + inline static Primitive emptyValue(uint v); static inline Primitive fromBoolean(bool b); static inline Primitive fromInt32(int i); inline static Primitive undefinedValue(); @@ -556,6 +568,13 @@ inline Primitive Primitive::emptyValue() return v; } +inline Primitive Primitive::emptyValue(uint e) +{ + Primitive v; + v.setEmpty(e); + return v; +} + inline Primitive Primitive::nullValue() { Primitive v; |