diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2013-06-26 12:41:21 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-06-26 15:45:55 +0200 |
commit | 500f3c2848152aeb6aae320adfb32dd0b374e22b (patch) | |
tree | 0772a97225985424040810efa8c38f32cdb340a3 /src/qml/qml/qqmlbinding_p.h | |
parent | 972094c109febebfb0376970bfc742d4200bcd14 (diff) |
Fix crashes with MSVC on x86
When returning a struct like QV4::Value from a function, the compiler can
either place the return value into the stack by expecting the caller
to provide a hidden first argument (pointer to where to store the value)
or pass it in eax:edx. The choice of which approach to pick depends on
whether the type is known at function declaration time. In this case we
had a mismatch where qv4serialize.cpp had a function that returned a value
and it is implemented by calling another function that would return the value.
QV4::Value was forward-declared, and so when compiling the function, the
compiler would assume that the caller provided an invisible first argument
for return value storage. The caller (in qquickworkerscript.cpp) however
had fully visibility of QV4::Value at call time and therefore assumed that
the value is returned in eax:edx. This mismatch caused naturally all sorts
of funny crashes.
The approach chosen is to eliminate any forward declarations of QV4::Value
and instead include the definition where appropriate.
Change-Id: I33303d86964239d3be30d1096806c605cddb7bbc
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlbinding_p.h')
-rw-r--r-- | src/qml/qml/qqmlbinding_p.h | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/src/qml/qml/qqmlbinding_p.h b/src/qml/qml/qqmlbinding_p.h index 7b2f84d523..ea703e8d38 100644 --- a/src/qml/qml/qqmlbinding_p.h +++ b/src/qml/qml/qqmlbinding_p.h @@ -70,10 +70,6 @@ QT_BEGIN_NAMESPACE -namespace QV4 { -struct Value; -} - class QQmlContext; class Q_QML_PRIVATE_EXPORT QQmlBinding : public QQmlJavaScriptExpression, public QQmlAbstractExpression, |