mirror of
https://github.com/N64Recomp/N64Recomp.git
synced 2026-05-15 07:29:46 -05:00
Three engine fixes uncovered by Stadium fragment dispatch: 1. recompilation.cpp: SectionAbsolute guard in print_func_call_by_address. Stadium's .fragmentN sections JAL into SHN_ABS symbols (e.g. osGbpakReadWrite); resolve_jal indexed context.sections[] at 65534 and segfaulted on first dispatch. Skip reloc resolution when reloc_section >= context.sections.size(). 2. main.cpp (overlay table emit): filter unsupported MIPS reloc types before indexing reloc_names[]. Stadium's .rel.fragmentN includes R_MIPS_PC16 (type 10) which the recompiler doesn't model; the OOB read embedded a NUL byte in the .type field and broke the C compile. 3. main.cpp: bounds-check inversion in the static-funcs scan (read section_funcs[size] before checking i < size). Latent bug exposed by .fragment1's larger CreateStatic surface. 4. recomp.h: forward-declare recomp_register_runtime_fragment so funcs files can call it from inlined hook text generated by [[patches.hook]] on Memmap_RelocateFragment. (NOTE: original local commit de76241 also added a recomp_unhandled_* forward-decl family; those declarations are dropped from this PR — they violate the no-stubs principle and depend on a runtime API not yet in upstream N64ModernRuntime.) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| recompiler | ||
| recomp.h | ||