diff options
author | Erik Verbruggen <erik.verbruggen@digia.com> | 2016-06-16 13:39:57 +0200 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@qt.io> | 2016-06-16 12:32:36 +0000 |
commit | aa7c3b35ef9b737c574f436ea35452019a2ff29c (patch) | |
tree | e0656e5e17350f6f9adb4ffebd7cb8521f062cc6 /src/qml/jsruntime/qv4scopedvalue_p.h | |
parent | d2f1e081b9de201fd45e67b78567c6d720d0c6bf (diff) |
V4: Always set the tag when boxing a pointer in QV4::Value.
All setters now store tags, so no-one can play loosy-goosy with the
boxed values (and accidentally forget to "tag" a value, resulting in
random garbage).
Change-Id: Ia0b78aa038d3ff46d5292b14bd593de310da16a0
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4scopedvalue_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4scopedvalue_p.h | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/src/qml/jsruntime/qv4scopedvalue_p.h b/src/qml/jsruntime/qv4scopedvalue_p.h index ca7efb1e79..0b063ee4b8 100644 --- a/src/qml/jsruntime/qv4scopedvalue_p.h +++ b/src/qml/jsruntime/qv4scopedvalue_p.h @@ -120,9 +120,6 @@ struct ScopedValue { ptr = scope.engine->jsStackTop++; ptr->setM(o); -#ifndef QV4_USE_64_BIT_VALUE_ENCODING - ptr->setTag(QV4::Value::Managed_Type); -#endif } ScopedValue(const Scope &scope, Managed *m) @@ -144,9 +141,6 @@ struct ScopedValue ScopedValue &operator=(Heap::Base *o) { ptr->setM(o); -#ifndef QV4_USE_64_BIT_VALUE_ENCODING - ptr->setTag(QV4::Value::Managed_Type); -#endif return *this; } @@ -186,18 +180,12 @@ struct Scoped inline void setPointer(const Managed *p) { ptr->setM(p ? p->m() : 0); -#ifndef QV4_USE_64_BIT_VALUE_ENCODING - ptr->setTag(QV4::Value::Managed_Type); -#endif } Scoped(const Scope &scope) { ptr = scope.engine->jsStackTop++; ptr->setM(0); -#ifndef QV4_USE_64_BIT_VALUE_ENCODING - ptr->setTag(QV4::Value::Managed_Type); -#endif } Scoped(const Scope &scope, const Value &v) @@ -339,14 +327,14 @@ struct ScopedCallData { inline Value &Value::operator =(const ScopedValue &v) { - _val = v.ptr->val(); + _val = v.ptr->rawValue(); return *this; } template<typename T> inline Value &Value::operator=(const Scoped<T> &t) { - _val = t.ptr->val(); + _val = t.ptr->rawValue(); return *this; } |