Commit 03a811a2

03a811a21209Merged

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

Description

fix: drop dead sub = @nd_subsequent[rc] from bare-rescue branch

The bare-rescue branch of compile_rescue_chain assigned sub solely as the last statement before the end, with a comment saying the value is ignored. Spinel's return-inference then treated the trailing assignment as the method's return value and emitted return lv_sub; in C — inside a function whose inferred return type is sp_StrArray *. gcc correctly warned about the type mismatch.

Remove the dead assignment; add an explicit 0 return so no branch leaks a trailing expression. Clears the -Wint-conversion warning at gen1.c:28816 / gen2.c:28816.

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

Details

Commit
03a811a21209
Parent
2383c40d7d0b

spinel_codegen.rbmodifiedView file

@@ -19941,11 +19941,10 @@
1994119941 @indent = @indent - 1
1994219942 end
1994319943 emit(" }")
19944- else
19945- # No type check - bare rescue, catches all
19946- sub = @nd_subsequent[rc]
19947- # Ignore subsequent since bare rescue catches all
1994819944 end
19945+ # Bare rescue catches all, so any subsequent clause is unreachable
19946+ # and we deliberately don't recurse.
19947+ 0
1994919948 end
1995019949
1995119950 def compile_rescue_body(nid, has_retry)