mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-06-01 20:25:21 -06:00
Refactor ExecuteGuest to simplify stack clearing logic
This enough for GR2
This commit is contained in:
parent
2f885b6c21
commit
5ae377decf
@ -59,9 +59,9 @@ void ClearStack() {
|
|||||||
|
|
||||||
template <class ReturnType, class... FuncArgs, class... CallArgs>
|
template <class ReturnType, class... FuncArgs, class... CallArgs>
|
||||||
ReturnType ExecuteGuest(PS4_SYSV_ABI ReturnType (*func)(FuncArgs...), CallArgs&&... args) {
|
ReturnType ExecuteGuest(PS4_SYSV_ABI ReturnType (*func)(FuncArgs...), CallArgs&&... args) {
|
||||||
// clear stack to avoid trash from EnsureThreadInitialized (skip on fiber stacks)
|
// clear stack to avoid trash from EnsureThreadInitialized
|
||||||
auto* tcb = GetTcbBase();
|
auto* tcb = GetTcbBase();
|
||||||
if (tcb == nullptr || tcb->tcb_fiber == nullptr) {
|
if (tcb == nullptr) {
|
||||||
ClearStack<12_KB>();
|
ClearStack<12_KB>();
|
||||||
}
|
}
|
||||||
return func(std::forward<CallArgs>(args)...);
|
return func(std::forward<CallArgs>(args)...);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user