Fix rare crashes in release builds on Windows with exceptions
authorSimon Hausmann <simon.hausmann@digia.com>
Tue, 9 Jul 2013 11:42:09 +0000 (13:42 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Wed, 10 Jul 2013 11:02:01 +0000 (13:02 +0200)
commit5706bda12306130c187d7fa1b7767ede0be34c84
treeb744528aeb6858048cdc9143eb31bdaa1449a1ad
parentce3767f3716bbc92a31b2008dc749f4840c23718
Fix rare crashes in release builds on Windows with exceptions

When throwing exceptions we have a tendency to save a backtrace, using
StackWalk64 on Windows. Before we can do that stack walk, we have to
capture the current processor register state, in particular the frame pointer,
for which we call RtlCaptureContext. Almost naturally that function requires
the caller to have set up a stack frame, which may not have happened when
compiling with release flags.

As a remedy, this patch moves the code that calls RtlCaptureContext into
a separate file, which will be compiled with frame pointer optimizations
disabled.

Change-Id: I3ce53b47c4a421efeaa3e575429d85327540ca97
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
src/qml/qml/v4/qv4engine.cpp
src/qml/qml/v4/qv4stacktrace.cpp [new file with mode: 0644]
src/qml/qml/v4/qv4stacktrace_p.h [new file with mode: 0644]
src/qml/qml/v4/v4.pri