mirror of
https://github.com/momo5502/emulator.git
synced 2026-01-19 11:43:56 +00:00
Fix vm crash when teb.ThreadLocalStoragePointer is null
This commit is contained in:
@@ -309,6 +309,11 @@ namespace syscalls
|
||||
const auto tls_vector = teb.ThreadLocalStoragePointer;
|
||||
constexpr auto ptr_size = sizeof(EmulatorTraits<Emu64>::PVOID);
|
||||
|
||||
if (!tls_vector)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (tls_info.TlsRequest == ProcessTlsReplaceIndex)
|
||||
{
|
||||
const auto tls_entry_ptr = tls_vector + (tls_info.TlsIndex * ptr_size);
|
||||
|
||||
Reference in New Issue
Block a user