From c7dcca779dc1eae77300895f880043521ea90679 Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Fri, 2 Sep 2022 13:43:20 +0200 Subject: [PATCH] :art: Fix VM warnings --- src/vm/vm.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/vm/vm.c b/src/vm/vm.c index 0fcd17c8..a0ab5a89 100644 --- a/src/vm/vm.c +++ b/src/vm/vm.c @@ -278,10 +278,6 @@ ANN static VM_Shred init_fork_shred(const VM_Shred shred, const VM_Code code, } //#define ADVANCE() { byte += BYTECODE_SZ; shred->pc++;} -#define ADVANCE() byte += BYTECODE_SZ - -//#define SDISPATCH() goto *dispatch[*(m_bit *)byte]; -#define SDISPATCH() goto **(void***)byte; #define IDISPATCH() \ { \ VM_INFO; \ @@ -427,12 +423,6 @@ _Pragma(STRINGIFY(COMPILER diagnostic ignored UNINITIALIZED) ADVANCE(); \ IDISPATCH(); -#define VM_OUT \ - shred->code = code; \ - shred->reg = reg; \ - shred->mem = mem; \ - shred->pc = PC; - __attribute__((hot)) void vm_prepare(const VM *vm, m_bit *prepare_code) { // lgtm [cpp/use-of-goto] static const void *dispatch[] = { @@ -494,6 +484,16 @@ vm_prepare(const VM *vm, m_bit *prepare_code) { // lgtm [cpp/use-of-goto] m_bit * reg = shred->reg; m_bit * mem = shred->mem; m_bit next; + +#define VM_OUT \ + shred->code = code; \ + shred->reg = reg; \ + shred->mem = mem; \ + shred->pc = PC; + +#define ADVANCE() byte += BYTECODE_SZ +#define SDISPATCH() goto **(void***)byte; + union { M_Object obj; VM_Code code; -- 2.43.0