diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2019-04-30 11:22:23 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2019-05-07 07:36:24 +0000 |
commit | 3df85008591dffc64427095b022421469cb9a866 (patch) | |
tree | 5ed97536bf3a96d9c78c86fd743eae7f2d8ee3df /src/qml/compiler/qv4compileddata_p.h | |
parent | d2c089eb11d3ad6a9917efde8f13b36931b35baf (diff) |
Avoid std::function in qqmlirbuilder.cpp
Some compilers seem to miscompile this construction. Furthermore, it
doesn't really add to the readability of the code. Inline the code in
question at the only place it's used and avoid most of the const_cast by
adding a non-const accessor to CompiledData::Unit.
Fixes: QTBUG-75392
Change-Id: I015317f28a92817d08d616cc35956745758d7847
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4compileddata_p.h')
-rw-r--r-- | src/qml/compiler/qv4compileddata_p.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/qml/compiler/qv4compileddata_p.h b/src/qml/compiler/qv4compileddata_p.h index 3fd9fdf74b..76795f7aa3 100644 --- a/src/qml/compiler/qv4compileddata_p.h +++ b/src/qml/compiler/qv4compileddata_p.h @@ -891,6 +891,10 @@ struct Unit return reinterpret_cast<const QmlUnit *>(reinterpret_cast<const char *>(this) + offsetToQmlUnit); } + QmlUnit *qmlUnit() { + return reinterpret_cast<QmlUnit *>(reinterpret_cast<char *>(this) + offsetToQmlUnit); + } + bool isSingleton() const { return flags & Unit::IsSingleton; } |