From: Brendan Hansen Date: Wed, 13 Dec 2023 16:58:46 +0000 (-0600) Subject: fixed: flag controlling tail calls for Linux build X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=2a0d19efb0bba8ab9418576443112ab11a410397;p=onyx.git fixed: flag controlling tail calls for Linux build --- diff --git a/interpreter/src/vm/vm_instrs.h b/interpreter/src/vm/vm_instrs.h index 97956aed..f5e609c9 100644 --- a/interpreter/src/vm/vm_instrs.h +++ b/interpreter/src/vm/vm_instrs.h @@ -24,10 +24,16 @@ #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]