diff options
author | Erik Verbruggen <erik.verbruggen@theqtcompany.com> | 2016-05-26 17:46:24 +0200 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@qt.io> | 2016-06-08 08:04:53 +0000 |
commit | ce0800060246e68fffc226b366cb4b0ea2e41ded (patch) | |
tree | 1a79104c19a84611d3207456438b4054703f2f56 /src/qml/jsruntime/qv4persistent_p.h | |
parent | fc83d811812d2e16f4139f6db7e357b5d2eb945b (diff) |
V4: tighten up various casts to check also check type.
All those type conversions assumed that the content of a Value was
either the requested type, or 0 (zero, a null pointer). Now, attempting
to convert e.g. undefined to a string will fail, instead of returning a
weird address.
Change-Id: I0f567cdcc9cc9728d019f17693f4a6007394a9c6
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4persistent_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4persistent_p.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4persistent_p.h b/src/qml/jsruntime/qv4persistent_p.h index 5b1926468a..a0ade2068f 100644 --- a/src/qml/jsruntime/qv4persistent_p.h +++ b/src/qml/jsruntime/qv4persistent_p.h @@ -118,7 +118,7 @@ public: Managed *asManaged() const { if (!val) return 0; - return val->as<Managed>(); + return val->managed(); } template<typename T> T *as() const { @@ -167,7 +167,7 @@ public: Managed *asManaged() const { if (!val) return 0; - return val->as<Managed>(); + return val->managed(); } template <typename T> T *as() const { |