diff --git a/src/scripting/backend/codegen.cpp b/src/scripting/backend/codegen.cpp index 07f1ba287..ba1c72c28 100644 --- a/src/scripting/backend/codegen.cpp +++ b/src/scripting/backend/codegen.cpp @@ -6534,7 +6534,7 @@ ExpEmit FxSelf::Emit(VMFunctionBuilder *build) { build->Emit(OP_EQA_R, 1, 0, 1); build->Emit(OP_JMP, 1); - //build->Emit(OP_THROW, 2, X_BAD_SELF); + build->Emit(OP_THROW, 2, X_BAD_SELF); } // self is always the first pointer passed to the function return ExpEmit(0, REGT_POINTER, false, true); diff --git a/src/scripting/vm/vmexec.h b/src/scripting/vm/vmexec.h index 9640103ba..adb0480de 100644 --- a/src/scripting/vm/vmexec.h +++ b/src/scripting/vm/vmexec.h @@ -821,7 +821,9 @@ static int Exec(VMFrameStack *stack, const VMOP *pc, VMReturn *ret, int numret) assert(a <= try_depth); try_depth -= a; NEXTOP; +#endif OP(THROW): +#if 0 if (a == 0) { ASSERTA(B); @@ -834,10 +836,12 @@ static int Exec(VMFrameStack *stack, const VMOP *pc, VMReturn *ret, int numret) ThrowVMException((VMException *)konsta[B].o); } else +#endif { ThrowAbortException(EVMAbortException(BC), nullptr); } NEXTOP; +#if 0 OP(CATCH): // This instruction is handled by our own catch handler and should // not be executed by the normal VM code. diff --git a/src/scripting/vm/vmops.h b/src/scripting/vm/vmops.h index cf49d9834..50f6568cb 100644 --- a/src/scripting/vm/vmops.h +++ b/src/scripting/vm/vmops.h @@ -116,7 +116,7 @@ xx(NEW, new, RPRPI8, NOP, 0, 0), xx(NEW_K, new, RPKP, NOP, 0, 0), //xx(TRY, try, I24, NOP, 0, 0), // When an exception is thrown, start searching for a handler at pc + ABC //xx(UNTRY, untry, I8, NOP, 0, 0), // Pop A entries off the exception stack -//xx(THROW, throw, THROW, NOP, 0, 0), // A == 0: Throw exception object pB +xx(THROW, throw, THROW, NOP, 0, 0), // A == 0: Throw exception object pB // A == 1: Throw exception object pkB // A >= 2: Throw VM exception of type BC //xx(CATCH, catch, CATCH, NOP, 0, 0), // A == 0: continue search on next try