diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-05-11 21:10:11 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-05-11 20:52:40 +0000 |
commit | 2d6b08bd17377aa6bcb663029a196a8d19cac6ac (patch) | |
tree | 4bce8e27455c38b919a5a1706c6bb5b8b7f8813a /src/qml/jsruntime/qv4vme_moth.cpp | |
parent | bde97ab6a72acafaa29d2da0f7a31ae23918a6b0 (diff) |
Give for loops a per-iteration context as well
Regular for loops also have a per iteration context for lexically
declared variables as well.
Change-Id: I35cb58bfb198c7dc32d70f41ea0ced7ddefcc37e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4vme_moth.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4vme_moth.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4vme_moth.cpp b/src/qml/jsruntime/qv4vme_moth.cpp index 3fadb6e670..5daead19d2 100644 --- a/src/qml/jsruntime/qv4vme_moth.cpp +++ b/src/qml/jsruntime/qv4vme_moth.cpp @@ -929,11 +929,18 @@ QV4::ReturnedValue VME::interpret(CppStackFrame &frame, const uchar *code) MOTH_END_INSTR(PushWithContext) MOTH_BEGIN_INSTR(PushBlockContext) + STORE_ACC(); STACK_VALUE(reg) = STACK_VALUE(CallData::Context); ExecutionContext *c = static_cast<ExecutionContext *>(stack + CallData::Context); STACK_VALUE(CallData::Context) = Runtime::method_createBlockContext(c, index); MOTH_END_INSTR(PushBlockContext) + MOTH_BEGIN_INSTR(CloneBlockContext) + STORE_ACC(); + ExecutionContext *c = static_cast<ExecutionContext *>(stack + CallData::Context); + STACK_VALUE(CallData::Context) = Runtime::method_cloneBlockContext(c); + MOTH_END_INSTR(CloneBlockContext) + MOTH_BEGIN_INSTR(PushScriptContext) STACK_VALUE(CallData::Context) = Runtime::method_createScriptContext(engine, index); MOTH_END_INSTR(PushScriptContext) |