Skip to content

[AUTOMATED] Report indirect-jump fallback only for surviving calls - #1984

Merged
mahaloz merged 5 commits into
Noelo-Lab:mainfrom
thotypous:kuna-live-jump-as-call-warning
Nov 26, 2026
Merged

mahaloz merged 5 commits into
Noelo-Lab:mainfrom
thotypous:kuna-live-jump-as-call-warning

Conversation

@thotypous

@thotypous thotypous commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Kuna adds jump-as-call to a return even when it proved the indirect jump unreachable. The ARM code below compares r1 with itself, so bxne r0 cannot execute.

printf '\x01\x00\x51\xe1\x10\xff\x2f\x11\x1e\xff\x2f\xe1' > /tmp/dead-jump-arm.bin
kuna decompile /tmp/dead-jump-arm.bin 0x10000 --target ARM:LE:32:v7 \
  --isa arm --addr --raw-image --base 0x10000

Before: return; // jump-as-call. After: return;.

Keep the jump-table fallback on its replacement call and publish the diagnostic only if the call survives simplification. The same fix applies to an unreachable indirect loop restart in Carmel (#1936).

The ARM regression checks both the dead jump and a live conditional call that must keep its warning. No output or scoring changes across 770 DecBench binaries; no output changes across 146 Debian binaries spanning 13 ABIs.

Dependency for the Carmel PR (#1936): this keeps warnings off loop restarts that simplify away.

Model: openai-codex/gpt-6.2-sol

thotypous and others added 4 commits November 26, 2026 02:35
- Retain the failed jump-table classification on its replacement call through analysis.
- Keep inline and structured warnings for reachable fallback calls without attributing pruned calls to neighboring statements.
…at its address

Flow used to publish the indirect-jump fallback warning before the pipeline
ran, so a pipeline warning at the same address printed after it. Publishing
the call's warning after the pending pipeline comments flipped that order
(`// return-dupe, jump-as-call` in libopencm3's unwind_phase2). Publish it
first so every surviving warning prints as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
Chapter 2 still said flow emits the warning; it now marks the call a bad
jump table and the warning follows the call. Chapter 9 names the drive step
that publishes it and its order, and the flow comment no longer lists
setBadJumpTable as a stub.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
…rning

libgcc's Thumb unwind_phase2 keeps its udf trap as a live fallback call and
returndup's warning lands on the same address. The stage now checks that it
prints `// jump-as-call, return-dupe` as it did before the warning moved to
the end of the drive.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
@mahaloz

mahaloz commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

[AUTOMATED] Pushed three small commits on top:

  • ec7db30a5: publish the surviving call's warning before the pipeline's own comments. Publishing it after them flipped the order at a shared address. libgcc's Thumb unwind_phase2 (libopencm3, O0/O2/O2-noinline) printed // return-dupe, jump-as-call where main prints // jump-as-call, return-dupe. With this, a base-vs-head decompile-all --json over 243 binaries (x86-64 O0/O2, ARM, i386 PE, MIPS, PPC32, RISC-V, AArch64; 39,933 functions) is byte-identical.
  • b1e146630: adds that function as JUMPAS-CALL #4 to the stage (it fails on the previous head), anchors #1 to end of line, and re-records docs/baseline-stages.json (5522).
  • edb626dad: chapter 2 now says flow marks the call a bad jump table instead of emitting the warning, and chapter 9 names drain_pipeline_comments.

docs/baseline-stages.json is re-recorded on the merged tree (5520 on main
plus the stage's four JUMPAS-CALL assertions).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
@mahaloz
mahaloz merged commit 5eaefeb into Noelo-Lab:main Nov 26, 2026
2 checks passed
mahaloz added a commit to phix33/kuna that referenced this pull request Nov 26, 2026
…O64 selection branch

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013BBaWTdjVzTz11WxPZmJ9b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants