mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-30 14:04:55 +00:00
clang, don't optimize me 🚨
avoid ClearStack function being optimized in release builds
This commit is contained in:
parent
3f9f7adae4
commit
108f96096b
@ -44,9 +44,9 @@ Tcb* GetTcbBase();
|
||||
void EnsureThreadInitialized();
|
||||
|
||||
template <size_t size>
|
||||
void ClearStack() {
|
||||
void* buf = alloca(size);
|
||||
memset(buf, 0, size);
|
||||
__attribute__((optnone)) void ClearStack() {
|
||||
volatile void* buf = alloca(size);
|
||||
memset(const_cast<void*>(buf), 0, size);
|
||||
buf = nullptr;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user