From: fennecdjay Date: Fri, 2 Sep 2022 11:43:20 +0000 (+0200) Subject: :art: Fix VM warnings X-Git-Tag: nightly~264^2~19 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=c7dcca779dc1eae77300895f880043521ea90679;p=gwion.git :art: Fix VM warnings --- 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;