mirror of
https://github.com/HeyPuter/gex.git
synced 2026-11-13 18:34:21 -10:00
A call-out's caller counted as unwound past when the guest's stack
pointer was above its frame. A fiber has a stack of its own: while a
callback's call-out was open and another fiber ran on a stack above it,
a safepoint (or gexrt's leave check, or a change of mode on the page)
abandoned the call-out, and the callback's return later reached native
Wine's return pad with no call-out catching it ("gex: BUG: a guest
return reached native Wine's return pad").
Each call-out now records the top of the stack it was made on, its
thread's TEB StackBase then (a fiber switch changes it), and only a
stack pointer between its frame and that top says the caller has been
left: x86::callout_stack_top, the native host's Callout::left, and on
the page gex_callout_stack_top, #left and gex_callout_guard's new top.
A call-out whose TEB names no stack holding its frame keeps the old
rule.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_853378b774d645b4ac78b16d9af91a31