fixed: flag controlling tail calls for Linux build
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Wed, 13 Dec 2023 16:58:46 +0000 (10:58 -0600)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Wed, 13 Dec 2023 16:58:46 +0000 (10:58 -0600)
interpreter/src/vm/vm_instrs.h

index 97956aed05827483052aefbf12571c65794620ae..f5e609c9c496e251af78ea60052f7fc619f87723 100644 (file)
 #define OVMI_INSTR_EXEC(name) \
     static OVMI_INSTR_PROTO(OVMI_FUNC_NAME(name))
 
+#if _BH_DARWIN
+    #define FORCE_TAILCALL __attribute__((musttail))
+#else
+    #define FORCE_TAILCALL
+#endif
+
 #define NEXT_OP \
     OVMI_DEBUG_HOOK; \
     instr = &code[state->pc++]; \
-    __attribute__((musttail)) return OVMI_DISPATCH_NAME[instr->full_instr & OVM_INSTR_MASK](instr, state, values, memory, code);
+    FORCE_TAILCALL return OVMI_DISPATCH_NAME[instr->full_instr & OVM_INSTR_MASK](instr, state, values, memory, code);
 
 #define VAL(loc) values[loc]