From 93a5d821d95dad9424443f24333f155f165c25ec Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Thu, 21 Feb 2019 19:52:20 +0100 Subject: [PATCH] :art: Except opcode offset now fixed --- src/emit/emit.c | 12 ++++++------ src/vm/vm.c | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/emit/emit.c b/src/emit/emit.c index 876dd314..9e0388d3 100644 --- a/src/emit/emit.c +++ b/src/emit/emit.c @@ -729,8 +729,8 @@ ANN static Instr emit_call(const Emitter emit, const Func f) { FuncMember : FuncStatic : FuncUsr; return emit_add_instr(emit, exec); } - const Instr ex = emit_add_instr(emit, GWOP_EXCEPT); - ex->m_val = -SZ_INT; + /*const Instr ex = */emit_add_instr(emit, GWOP_EXCEPT); +// ex->m_val = -SZ_INT; return emit_add_instr(emit, FuncPtr); } @@ -1420,8 +1420,8 @@ ANN static m_bool emit_dot_static_func(const Emitter emit, const Func func) { GW ANN static m_bool emit_member_func(const Emitter emit, const Exp_Dot* member, const Func func) { GWDEBUG_EXE if(emit_exp(emit, member->base, 0) < 0) ERR_B(member->self->pos, "... in member function") // LCOV_EXCL_LINE - const Instr ex = emit_add_instr(emit, GWOP_EXCEPT); - ex->m_val = -SZ_INT; + /*const Instr ex = */emit_add_instr(emit, GWOP_EXCEPT); + //ex->m_val = -SZ_INT; if(GET_FLAG(member->base->type, force)) { const Instr func_i = emit_add_instr(emit, RegPushImm); func_i->m_val = (m_uint)func->code; @@ -1437,8 +1437,8 @@ ANN static m_bool emit_member_func(const Emitter emit, const Exp_Dot* member, co } ANN static inline void emit_member(const Emitter emit, const Value v, const uint emit_addr) { - const Instr ex = emit_add_instr(emit, GWOP_EXCEPT); - ex->m_val = -SZ_INT; + /*const Instr ex = */emit_add_instr(emit, GWOP_EXCEPT); + //ex->m_val = -SZ_INT; const m_uint size = v->type->size; const Instr instr = emit_kind(emit, size, emit_addr, dotmember); instr->m_val = v->offset; diff --git a/src/vm/vm.c b/src/vm/vm.c index e69eb31e..edb3e093 100644 --- a/src/vm/vm.c +++ b/src/vm/vm.c @@ -716,7 +716,7 @@ remref: release(*(M_Object*)(mem + instr->m_val), shred); DISPATCH() except: - if(!(a.obj = *(M_Object*)(reg+instr->m_val))) + if(!(a.obj = *(M_Object*)(reg-SZ_INT))) Except(shred, "NullPtrException"); DISPATCH(); allocmemberaddr: -- 2.43.0