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
@indent = @indent - 1 end emit(" }") else # No type check - bare rescue, catches all sub = @nd_subsequent[rc] # Ignore subsequent since bare rescue catches all end # Bare rescue catches all, so any subsequent clause is unreachable # and we deliberately don't recurse. 0 end def compile_rescue_body(nid, has_retry)