Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion Source/Windows/WOW64/Module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,14 @@ bool BTCpuResetToConsistentStateImpl(EXCEPTION_POINTERS* Ptrs) {
auto* Context = Ptrs->ContextRecord;
auto* Exception = Ptrs->ExceptionRecord;
auto Thread = GetTLS().ThreadState();
// Exceptions can arrive during process/thread initialization, before the FEX
// thread is published in TLS. Profiling and the JIT handlers dereference it,
// so let Wine dispatch these faults instead of recursively faulting here.
// Overcommit faults are process-wide and can still be handled at this stage.
if (!Thread) {
return Exception->ExceptionCode == EXCEPTION_ACCESS_VIOLATION && OvercommitTracker &&
OvercommitTracker->HandleAccessViolation(static_cast<uint64_t>(Exception->ExceptionInformation[1]));
}
FEXCORE_PROFILE_ACCUMULATION(Thread, AccumulatedSignalTime);

if (Exception->ExceptionCode == EXCEPTION_ACCESS_VIOLATION) {
Expand Down Expand Up @@ -769,7 +777,7 @@ bool BTCpuResetToConsistentStateImpl(EXCEPTION_POINTERS* Ptrs) {
}
}

if (!Thread || !IsAddressInJit(Context->Pc)) {
if (!IsAddressInJit(Context->Pc)) {
return false;
}

Expand Down
Loading