Commit eeaef51d

eeaef51dcf7aMerged

Yukihiro "Matz" Matsumoto <[email protected]> · 6 months ago · 1 file · ~1 modified

Description

fix(codegen): drop duplicate poly .call arm conflicting with #458

PR #458 (commit d9bf5e7) already added a SP_BUILTIN_PROC arm to emit_poly_builtin_dispatch. This branch added a second identical arm, so every .call on a poly receiver was emitted twice and each proc in a poly_array iteration ran twice. The failure surfaced as duplicated output in io_call_in_proc_body, proc_array_push, and proc_body_nested_block.

Co-Authored-By: Claude Opus 4.7 (1M context) [email protected]

Details

Commit
eeaef51dcf7a
Parent
148fc23801a9

spinel_codegen.rbmodifiedView file

@@ -18719,15 +18719,6 @@
1871918719 polyrhs = is_poly_ret == 1 ? "sp_box_int(" + polyc + ")" : polyc
1872018720 emit(" if (" + recv_tmp + ".cls_id == SP_BUILTIN_POLY_ARRAY) " + result_tmp + " = " + polyrhs + ";")
1872118721 end
18722- if mname == "call"
18723- ca = (arg_compiled.length > 0) ? arg_compiled.join(", ") : ""
18724- if ca == ""
18725- ca = "0"
18726- end
18727- pc = "sp_proc_call((sp_Proc *)" + recv_tmp + ".v.p, (mrb_int[]){" + ca + "})"
18728- prhs = is_poly_ret == 1 ? "sp_box_int(" + pc + ")" : pc
18729- emit(" if (" + recv_tmp + ".cls_id == SP_BUILTIN_PROC) " + result_tmp + " = " + prhs + ";")
18730- end
1873118722 end
1873218723
1873318724 # Try to compile str[i] <op> "c" as direct char comparison