mirror of
https://github.com/ccxvii/mujs.git
synced 2026-02-05 17:29:43 +08:00
Bug 700947: Add missing ENDTRY opcode in try/catch/finally byte code.
In one of the code branches in handling exceptions in the catch block we forgot to call the ENDTRY opcode to pop the inner hidden try. This leads to an unbalanced exception stack which can cause a crash due to us jumping to a stack frame that has already been exited.
This commit is contained in:
@@ -1023,6 +1023,7 @@ static void ctrycatchfinally(JF, js_Ast *trystm, js_Ast *catchvar, js_Ast *catch
|
||||
emitstring(J, F, OP_CATCH, catchvar->string);
|
||||
cstm(J, F, catchstm);
|
||||
emit(J, F, OP_ENDCATCH);
|
||||
emit(J, F, OP_ENDTRY);
|
||||
L3 = emitjump(J, F, OP_JUMP); /* skip past the try block to the finally block */
|
||||
}
|
||||
label(J, F, L1);
|
||||
|
||||
Reference in New Issue
Block a user