From 078eb28e0c657b8107c5e8be873b3503fdea7ed2 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 13 May 2019 17:53:06 +0200 Subject: Do not take a reference of nullptr References are not allowed to be null, but we pass a nullptr as receiver in QQmlContextWrapper::resolveQmlContextPropertyLookupGetter. Detected with UBSAN. Change-Id: Iaa7945fb17e4b0e549e541e47589b2f47d32ea4e Reviewed-by: Simon Hausmann Reviewed-by: Ulf Hermann --- src/qml/jsruntime/qv4object_p.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/qml/jsruntime/qv4object_p.h') diff --git a/src/qml/jsruntime/qv4object_p.h b/src/qml/jsruntime/qv4object_p.h index c3f1cb2c35..bee4aadafe 100644 --- a/src/qml/jsruntime/qv4object_p.h +++ b/src/qml/jsruntime/qv4object_p.h @@ -185,22 +185,22 @@ struct Q_QML_EXPORT Object: Managed { // // helpers // - static ReturnedValue getValue(const Value &thisObject, const Value &v, PropertyAttributes attrs) { + static ReturnedValue getValue(const Value *thisObject, const Value &v, PropertyAttributes attrs) { if (attrs.isData()) return v.asReturnedValue(); return getValueAccessor(thisObject, v, attrs); } ReturnedValue getValue(const Value &v, PropertyAttributes attrs) const { - return getValue(*this, v, attrs); + return getValue(this, v, attrs); } ReturnedValue getValueByIndex(uint propertyIndex) const { PropertyAttributes attrs = internalClass()->propertyData.at(propertyIndex); const Value *v = propertyData(propertyIndex); if (!attrs.isAccessor()) return v->asReturnedValue(); - return getValueAccessor(*this, *v, attrs); + return getValueAccessor(this, *v, attrs); } - static ReturnedValue getValueAccessor(const Value &thisObject, const Value &v, PropertyAttributes attrs); + static ReturnedValue getValueAccessor(const Value *thisObject, const Value &v, PropertyAttributes attrs); bool putValue(uint memberIndex, PropertyAttributes attrs, const Value &value); -- cgit v1.2.3