diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2017-04-04 15:59:50 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2017-04-06 10:30:13 +0000 |
commit | 0518ba4d2a1156c316a7bd251210837acd84bf48 (patch) | |
tree | 91442dbaab3794ab5bc1b54486bacaaf9bc32bfe /src/qml | |
parent | a182a659b54dddb865dd573e5411c3fe710b32fe (diff) |
Fix shadow stack space handling when cross-compiling
Both MIPS and X86-64 on Windows reserve space for four registers on the
stack, that the called function may use to spill the parameters passed
in registers.
This needs to be handled without #ifdefs in order to support
cross-compilation and from the looks of it it was also wrong on MIPS.
Change-Id: If65a6a0f6f64b8536703d32e7678e30ad807f7c8
Reviewed-by: Julien Brianceau <jbriance@cisco.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml')
-rw-r--r-- | src/qml/jit/qv4assembler_p.h | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/qml/jit/qv4assembler_p.h b/src/qml/jit/qv4assembler_p.h index 0570b9be2b..b512398966 100644 --- a/src/qml/jit/qv4assembler_p.h +++ b/src/qml/jit/qv4assembler_p.h @@ -1277,13 +1277,7 @@ public: if (argumentNumber < RegisterArgumentCount) loadArgumentInRegister(value, registerForArgument(argumentNumber), argumentNumber); else -#if OS(WINDOWS) && CPU(X86_64) - loadArgumentOnStack<argumentNumber>(value, argumentNumber); -#elif CPU(MIPS) // Stack space for 4 arguments needs to be allocated for MIPS platforms. - loadArgumentOnStack<argumentNumber>(value, argumentNumber + 4); -#else // Sanity: - loadArgumentOnStack<argumentNumber - RegisterArgumentCount>(value, argumentNumber); -#endif + loadArgumentOnStack<argumentNumber - RegisterArgumentCount + (StackShadowSpace / RegisterSize)>(value, argumentNumber); } template <int argumentNumber> |