Commit 2383c40d

2383c40d7d0bMerged

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

Description

fix: rename local in compile_mutating_call_stmt to avoid type collision

arg was used as both @nd_arguments[nid] (mrb_int) in the << / mutable_str branch and compile_arg0(nid) (const char *) in a later branch of the same method. scan_locals unifies the two and picks one C type; the other assignment then fires -Wint-conversion at compile time. Rename the int-typed slot to arg_id; the string-typed use keeps the arg name.

Clears both warnings on line 24278/24280 of gen1.c / gen2.c.

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

Details

Commit
2383c40d7d0b
Parent
b7dda7f451b8

spinel_codegen.rbmodifiedView file

@@ -16629,9 +16629,9 @@
1662916629 if rt == "mutable_str"
1663016630 @needs_mutable_str = 1
1663116631 rc = compile_expr(recv)
16632- arg = @nd_arguments[nid]
16633- if arg >= 0
16634- argl = parse_id_list(@nd_args[arg])
16632+ arg_id = @nd_arguments[nid]
16633+ if arg_id >= 0
16634+ argl = parse_id_list(@nd_args[arg_id])
1663516635 if argl.length > 0
1663616636 at = infer_type(argl[0])
1663716637 val = compile_expr(argl[0])