diff options
author | Erik Verbruggen <[email protected]> | 2016-09-09 15:37:57 +0200 |
---|---|---|
committer | Erik Verbruggen <[email protected]> | 2016-10-06 11:44:08 +0000 |
commit | 3b14e2ffdd8eb4b7f7f4508768b75f2acc399370 (patch) | |
tree | 7943f293bf2d0d376d5dc620448bab1a2b58027d /src/qml/jsruntime/qv4script.cpp | |
parent | 1b90dc4482d001512f09a5785d4cbd8030879d82 (diff) |
QML: Make Heap::Object and all subclasses trivial
GCC6 might dead-store-eliminate out our secret write to Base::mmdata,
because it expects all memory content to be "undefined" before
constructor calls. Clang might take the same approach if the constructor
of Heap::Object is removed.
By making these structs trivial, it also makes them memcpy-able.
Change-Id: I055b2ad28311b997fbe059849ebda4d5894eaa9b
Reviewed-by: Simon Hausmann <[email protected]>
Diffstat (limited to 'src/qml/jsruntime/qv4script.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4script.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/qml/jsruntime/qv4script.cpp b/src/qml/jsruntime/qv4script.cpp index e3475e5cd6..787047806a 100644 --- a/src/qml/jsruntime/qv4script.cpp +++ b/src/qml/jsruntime/qv4script.cpp @@ -65,7 +65,7 @@ namespace QV4 { namespace Heap { struct QmlBindingWrapper : FunctionObject { - QmlBindingWrapper(QV4::QmlContext *scope, Function *f); + void init(QV4::QmlContext *scope, Function *f); }; } @@ -84,9 +84,10 @@ using namespace QV4; DEFINE_OBJECT_VTABLE(QmlBindingWrapper); -Heap::QmlBindingWrapper::QmlBindingWrapper(QV4::QmlContext *scope, Function *f) - : Heap::FunctionObject(scope, scope->d()->engine->id_eval(), /*createProto = */ false) +void Heap::QmlBindingWrapper::init(QV4::QmlContext *scope, Function *f) { + Heap::FunctionObject::init(scope, scope->d()->engine->id_eval(), /*createProto = */ false); + Q_ASSERT(scope->inUse()); function = f; |