Files
psxrecomp/runtime
Matthew Stanley 29d6acfdcb overlay_loader: guard the index-traversal loops themselves on s_active
Completes 5b8098a (fail-closed lifecycle guards on the dispatch/is_candidate/
call_native entry points) at the root: overlay_find_by_range() and
lazy_has_exact_entry() are the loops that actually spin when the loader is
inactive — s_range_page_head[]/s_lazy_entry_head[] get their -1 empty
sentinels only from overlay_loader_init(), which runs solely under
overlay_cache=true (main.cpp). With overlay off they stay zero-initialized
(0 == a valid index), so any unguarded caller traverses a garbage index and
never terminates. That wedged every overlay-off + CPS game at boot before any
game code ran (found via Ape Escape, the only overlay-off title).

All present callers are already guarded; putting the guards inside the
traversal functions makes them safe by construction for any future caller.
Also records the CPS-wedge root cause on the dispatch guard.

Re-land of the overlay-off boot-wedge fix from 6da8c02 (stale branch), reduced
to the parts master's independent 5b8098a port did not already cover.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-15 22:12:25 -07:00
..