From a71ee754ee4bb88fc2d2fbe67972f24c5a6d7883 Mon Sep 17 00:00:00 2001 From: dqnne <173300634+dqnne@users.noreply.github.com> Date: Tue, 21 Jul 2026 12:53:41 +0200 Subject: [PATCH] build(api): unused labels in generated Lua bindings #40880 Problem: Generated API bindings for Lua contain unused jump labels when the API function has a non-KeyDict (e.g., Array) param after a KeyDict param, causing the build to fail. Solution: Don't output a label when the current parameter is not a KeyDict but the previous one is. --- src/gen/gen_api_dispatch.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gen/gen_api_dispatch.lua b/src/gen/gen_api_dispatch.lua index 731a9a0097..d243106750 100644 --- a/src/gen/gen_api_dispatch.lua +++ b/src/gen/gen_api_dispatch.lua @@ -952,7 +952,9 @@ local function process_function(fn) for i = 1, #free_code do local rev_i = #free_code - i + 1 local code = free_code[rev_i] - if i == 1 and not real_type(fn.parameters[1][1]):match('^KeyDict_') then + local cur_is_keydict = real_type(fn.parameters[i][1]):match('^KeyDict_') + local prev_is_keydict = i > 1 and real_type(fn.parameters[i - 1][1]):match('^KeyDict_') + if not cur_is_keydict and (i == 1 or prev_is_keydict) then free_at_exit_code = free_at_exit_code .. ('\n%s'):format(code) else free_at_exit_code = free_at_exit_code .. ('\nexit_%u:\n%s'):format(rev_i, code)