From: Lars Knoll Date: Thu, 13 Dec 2012 00:28:46 +0000 (+0100) Subject: Fix a possible crash when setting a property on a primitive type X-Git-Tag: upstream/5.2.1~669^2~659^2~698 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c4aa210e58e59d8cce233bfc5e9eb12ebda66a79;p=platform%2Fupstream%2Fqtdeclarative.git Fix a possible crash when setting a property on a primitive type Change-Id: Icb8d97536b87779cdc3e543260755509232e10cb Reviewed-by: Simon Hausmann --- 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); }