diff options
author | Erik Verbruggen <erik.verbruggen@digia.com> | 2012-11-14 10:15:19 +0100 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@digia.com> | 2012-11-14 11:45:03 +0100 |
commit | 8f69d75c785ff86face31db880abdb8414d1cbfe (patch) | |
tree | 6bd6fb4b6b445e1deeecda8e8bbed21e8120a503 /qmljs_objects.h | |
parent | 614b6c0a8d1c7621b423228a4bf4d1761503b148 (diff) |
Fix interpreter exception handling.
The stack frame of the interpreting function is restored, but all the
datastructures live on the heap. So, save them out on handler creation,
and restore them afterwards.
Change-Id: I84b84007cc9944b56926bf0387c2798f7841cd2a
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'qmljs_objects.h')
-rw-r--r-- | qmljs_objects.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/qmljs_objects.h b/qmljs_objects.h index 857b12bcd9..f40eab0802 100644 --- a/qmljs_objects.h +++ b/qmljs_objects.h @@ -582,13 +582,24 @@ struct ExecutionEngine String *id___proto__; struct ExceptionHandler { + struct InterpreterState { + QVector<VM::Value> stack; + int targetTempIndex; + const uchar *code; + }; + Context *context; jmp_buf stackFrame; + InterpreterState *interpreterState; + + ExceptionHandler(): interpreterState(0) {} + ~ExceptionHandler() { delete interpreterState; } }; - QVector<ExceptionHandler> unwindStack; + QVector<ExceptionHandler *> unwindStack; ExecutionEngine(); + ~ExecutionEngine() { qDeleteAll(unwindStack); } Context *newContext(); |