fix(ghidra): expose terminal-call boundary assumptions

Preserve observed terminal-call sites and callee flags across function views, raw bridge responses, Evidence, and snapshot replay. Version analysis profiles so older unqualified results cannot be reused.

Qualify Ghidra function extents without changing external no-return flags or claiming recovery of excluded code.

Validation: 76 focused tests, check:fast, docs:check, formatting, and the full Ghidra 12.1.4 host lane pass. Real CLI and all five stdio MCP function views retain the terminal-call evidence; returning puts calls remain unflagged. The reported stripped Rust ELF and Windows host remain unverified.

Fixes #1658
This commit is contained in:
morluto
2026-10-11 09:08:01 +08:00
parent 4733fc810a
commit 69a8b3a954
16 changed files with 457 additions and 55 deletions
+10
View File
@@ -1,4 +1,5 @@
#include <stdio.h>
#include <stdlib.h>
volatile int rea_ghidra_inventory_global = 7;
@@ -43,6 +44,15 @@ __attribute__((noinline, used)) int rea_ghidra_inventory_leaf(int value) {
return value + rea_ghidra_inventory_global;
}
// Ghidra's no-return analysis recognizes abort; this function provides a real
// terminal-call boundary while retaining a returning path.
__attribute__((noinline, used)) int rea_ghidra_inventory_terminal_call(
int should_abort) {
if (should_abort) abort();
puts("REA_GHIDRA_TERMINAL_CALL_RETURNED");
return should_abort;
}
// A reference into the function body can land inside an instruction.
__attribute__((used)) const unsigned char *volatile rea_ghidra_interior_pointer =
(const unsigned char *)(void *)rea_ghidra_inventory_leaf + 1;