From 451255455c3d12e1a63e84844978513764426ac9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Mon, 14 Sep 2020 13:14:47 +0200 Subject: [PATCH] :art: Update vm --- src/vm/vm.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/vm/vm.c b/src/vm/vm.c index ddecb99e..aa7cc19c 100644 --- a/src/vm/vm.c +++ b/src/vm/vm.c @@ -726,9 +726,9 @@ arraytop: else goto _goto; arrayaccess: - a.obj = *(M_Object*)(reg-VAL2); { register const m_int idx = *(m_int*)(reg + VAL); + a.obj = *(M_Object*)(reg-VAL2); if(idx < 0 || (m_uint)idx >= m_vector_size(ARRAY(a.obj))) { gw_err(_(" ... at index [%" INT_F "]\n"), idx); gw_err(_(" ... at dimension [%" INT_F "]\n"), VAL); @@ -739,10 +739,14 @@ arrayaccess: DISPATCH() } arrayget: +PRAGMA_PUSH() m_vector_get(ARRAY(a.obj), *(m_int*)(reg + VAL), (reg + (m_int)VAL2)); +PRAGMA_POP() DISPATCH() arrayaddr: +PRAGMA_PUSH() *(m_bit**)(reg + (m_int)VAL2) = m_vector_addr(ARRAY(a.obj), *(m_int*)(reg + VAL)); +PRAGMA_POP() DISPATCH() arrayvalid: // are we sure it is the array ? -- 2.43.0