[XThread] Fix TLS pointer bug

Guest code may directly read the tls_address field from thread
structure to access TLS, and it expects the dynamic TLS area pointer
This commit is contained in:
Herman S.
2025-10-20 09:52:27 +09:00
parent 22f21fada9
commit 9f8961c185

View File

@@ -188,7 +188,7 @@ void XThread::InitializeGuestObject() {
guest_thread->stack_base = (this->stack_base_);
guest_thread->stack_limit = (this->stack_limit_);
guest_thread->stack_kernel = (this->stack_base_ - 240);
guest_thread->tls_address = (this->tls_static_address_);
guest_thread->tls_address = (this->tls_dynamic_address_);
guest_thread->thread_state = 0;
uint32_t process_info_block_address =
creation_params_.guest_process ? creation_params_.guest_process