diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2013-03-04 12:12:21 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@digia.com> | 2013-03-04 13:15:10 +0100 |
commit | 2cf8be29bc31f557af47c143048b5bb70d6000cc (patch) | |
tree | ebd7a634b81f1463c201055528232864147e8549 /tools | |
parent | ab23a26e671ad56b868cf2237400b22be1173470 (diff) |
Cleanup: Get rid of manual unwind stack
Instead of doing the ExecutionContext unwinding at the time of throw, do it
at the time of catch, conveniently through an accept() method of the Exception
object. That allows us to get rid of the separate handler registration stack.
The only tricky part are that some execution contexts are allocated on the stack.
When exceptions are thrown through that, we have to catch, unwinding up until that
point (or rather the parent of the stack allocated context that's going to be
deleted) and then simply rethrow.
This patch also gets rid of the __builtin_delete_exception_handler. The next patch
will rename the remainder to what it really does now.
Change-Id: I00bb113b3a2fe24f7054c03fdfb8fed5cc1258b1
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/v4/main.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/v4/main.cpp b/tools/v4/main.cpp index d73fa480..89a25973 100644 --- a/tools/v4/main.cpp +++ b/tools/v4/main.cpp @@ -388,7 +388,8 @@ int main(int argc, char *argv[]) if (! qgetenv("SHOW_EXIT_VALUE").isEmpty()) std::cout << "exit value: " << qPrintable(result.toString(ctx)->toQString()) << std::endl; } - } catch (const QQmlJS::VM::Exception&) { + } catch (QQmlJS::VM::Exception& ex) { + ex.accept(ctx); showException(ctx); return EXIT_FAILURE; } |