mirror of
https://github.com/NaC-L/Mergen.git
synced 2026-05-12 09:40:34 +00:00
6d0157f26b
Cross-ABI call contract (AbiCallContract.hpp): - AbiKind enum (x64_msvc, x86_cdecl/stdcall/fastcall, unknown) - CallModelMode: strict (default) clobbers volatile regs, compat preserves all - CallEffects: arg regs, return regs, volatile set, stack cleanup, memory effect - Pre-built descriptors for x64 MSVC and x86 calling conventions - Structured diagnostics at every call site ([call-abi] prefix) Call-site semantics (lift_call): - applyPostCallEffects: assigns RAX=result, clobbers volatile in strict mode - emittedExternalCall flag: skips Unflatten inlining when CreateCall emitted - Import thunk detection (FF 25 jmp [IAT]): auto-outlines DLL imports - shouldOutlineCall hook: extensible policy for inline/outline decisions Bug fixes: - parseArgs(nullptr) duplicated RDI (18 values for 16-type slots) — now 16 GPRs + memory ptr - Unknown calls in lift_call never assigned RAX = call result — now they do - callFunctionIR routed through applyPostCallEffects for consistency Speculative inlining (disabled by default, opt-in via maxCallInlineBudget): - Budget-limited call inlining with bail-out to CreateCall + ABI effects - Worklist trimming on bail-out restores pre-call continuation - Works mechanically but needs smarter trigger policy (see open issue) Tests: - call_abi_compat_preserves_volatile: R10 survives, RAX = result - call_abi_strict_clobbers_volatile: R10 = undef, RBX preserved, RAX = result - call_abi_default_is_strict: verifies strict is the default - All existing baseline (90+), semantic (23/23), micro (15) tests pass - VMP 3.8.1 target produces identical a+b+c deobfuscation