From 529f9e81ed095ec8cb0f420386762745a6730cf6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Tue, 25 Feb 2020 00:35:15 +0100 Subject: [PATCH] :art: Make gack more dynamic --- src/lib/gack.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lib/gack.c b/src/lib/gack.c index 1fd00ed0..05bdecb8 100644 --- a/src/lib/gack.c +++ b/src/lib/gack.c @@ -63,6 +63,11 @@ ANN static void prepare_call(const VM_Shred shred, m_uint offset) { ANN void gack(const VM_Shred shred, const Instr instr) { Type t = (Type)instr->m_val; + if(isa(t, shred->info->vm->gwion->type[et_object]) > 0 && !GET_FLAG(t, force)) { + const M_Object o = *(M_Object*)(shred->reg - SZ_INT); + if(o) + t = o->type_ref; + } const VM_Code code = get_gack(t); if(GET_FLAG(code, builtin)) { ((f_gack)code->native_func)(t, (shred->reg - t->size), shred); -- 2.43.0