x32/Thread: Fix off-by-one in get_thread_area

12, 13, and 14 are the only valid TLS areas.
This commit is contained in:
LC committed 2026-07-10 06:06:30 -04:00
1 parent 77467eaf0c
commit 37b1432514
1 file changed
+1 -1
@@ -154,7 +154,7 @@ void RegisterThread(FEX::HLE::SyscallHandler* Handler) {
REGISTER_SYSCALL_IMPL_X32(get_thread_area, [](FEXCore::Core::CpuStateFrame* Frame, struct user_desc* u_info) -> uint64_t {
// Index to fetch comes from the user_desc
uint32_t Entry = u_info->entry_number;
if (Entry < TLS_NextEntry || Entry > TLS_MaxEntry) {
if (Entry < TLS_NextEntry || Entry >= TLS_MaxEntry) {
return -EINVAL;
}