From c4aa210e58e59d8cce233bfc5e9eb12ebda66a79 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Thu, 13 Dec 2012 01:28:46 +0100 Subject: [PATCH] Fix a possible crash when setting a property on a primitive type Change-Id: Icb8d97536b87779cdc3e543260755509232e10cb Reviewed-by: Simon Hausmann --- qmljs_runtime.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qmljs_runtime.cpp b/qmljs_runtime.cpp index 5ef2c6c..1768cbf 100644 --- a/qmljs_runtime.cpp +++ b/qmljs_runtime.cpp @@ -544,6 +544,8 @@ Value __qmljs_new_string_object(ExecutionContext *ctx, String *string) void __qmljs_set_property(ExecutionContext *ctx, Value object, String *name, Value value) { + if (! object.isObject()) + object = __qmljs_to_object(object, ctx); object.objectValue()->__put__(ctx, name, value); } -- 2.7.4