From 7f12f9825e9b1baf7273e375664f453dad06b515 Mon Sep 17 00:00:00 2001 From: Hugo Musso Gualandi Date: Tue, 9 Jul 2024 00:07:56 -0300 Subject: [PATCH] Slightly adjust frameenter/exit in generated C 1) Don't add blank lines around FRAMEENTER. static void function_03( lua_State *L, Udata * restrict K, TValue * restrict U ) { PALLENE_C_FRAMEENTER(L, "myfunc"); StackValue *base = L->top.p; ptrdiff_t base_offset = savestack(L, base); 2) Move the FRAMEEXIT to before the multi-return assignments. The assingments+return are a single thing. PALLENE_FRAMEEXIT(); *ret2 = x3; return x2; --- src/pallene/coder.lua | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/pallene/coder.lua b/src/pallene/coder.lua index cb5323ae..19ae5c75 100644 --- a/src/pallene/coder.lua +++ b/src/pallene/coder.lua @@ -465,9 +465,7 @@ function Coder:pallene_entry_point_definition(f_id) local frameexit = "" if self.flags.use_traceback then table.insert(prologue, util.render([[ - /**/ PALLENE_C_FRAMEENTER(L, "$name"); - /**/ ]], { name = func.name })); @@ -529,8 +527,8 @@ function Coder:pallene_entry_point_definition(f_id) ${prologue} /**/ ${body} - ${ret_mult} ${frameexit} + ${ret_mult} ${ret_stat} } ]], { @@ -623,9 +621,7 @@ function Coder:lua_entry_point_definition(f_id) local cargs = nargs if self.flags.use_traceback then frameenter = util.render([[ - /**/ PALLENE_LUA_FRAMEENTER(L, $fun_name); - /**/ ]], { fun_name = self:lua_entry_point_name(f_id), })