Fix failing GC related tests with gcc in release builds
authorSimon Hausmann <simon.hausmann@digia.com>
Thu, 4 Jul 2013 11:45:16 +0000 (13:45 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Fri, 5 Jul 2013 07:47:05 +0000 (09:47 +0200)
commit63193605eb71bd45d9b1a98991fee262c301849f
tree4a3f5ec5844e549516d7a0b1ae98e8e2ac79fe52
parentfe6ec7bcc17f88ab1aca5a7934d047456354c942
Fix failing GC related tests with gcc in release builds

Our conservative collector might is more likely to find old pointers
to QV4::Objects on the C stack in release builds, when gcc optimizes out
stores that seem unnecessary. These two tests are prone to that due to
temporary QV4::Values potentially ending up on the stack on x86,
because vmeProperty returns then through an invisible first argument that
is a pointer a a location on the stack.

This patch makes those temporaries explicit, clears them out after
usages and adds GCC pragmas to disable optimizations for these two
test functions.

Change-Id: Ie43841e869346792296911fee6fed80c745faeff
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp