diff options
Diffstat (limited to 'src/qml/jsruntime/qv4function_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4function_p.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4function_p.h b/src/qml/jsruntime/qv4function_p.h index 735dc558e1..1fc40d7209 100644 --- a/src/qml/jsruntime/qv4function_p.h +++ b/src/qml/jsruntime/qv4function_p.h @@ -49,6 +49,7 @@ #include "qv4value_def_p.h" #include <private/qv4compileddata_p.h> +#include <private/qv4engine_p.h> QT_BEGIN_NAMESPACE @@ -84,7 +85,17 @@ struct Function { const CompiledData::Function *compiledFunction; CompiledData::CompilationUnit *compilationUnit; - Value (*code)(ExecutionContext *, const uchar *); + inline Value code(ExecutionContext *ctx, const uchar *data) { + Value *stack = ctx->engine->jsStackTop; + try { + return codePtr(ctx, data); + } catch (...) { + ctx->engine->jsStackTop = stack; + throw; + } + } + + Value (*codePtr)(ExecutionContext *, const uchar *); const uchar *codeData; quint32 codeSize; |