Skip to content

Commit 15f9089

Browse files
committed
[BOX32] Don't abort when stack pointer is not correct on new thread, but return an error
1 parent e2ce483 commit 15f9089

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/libtools/threads32.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,11 @@ EXPORT int my32_pthread_create(x64emu_t *emu, void* t, void* attr, void* start_r
207207
own = 1;
208208
}
209209

210+
if((uintptr_t)stack>=0x100000000LL) {
211+
if(own) munmap(stack, stacksize);
212+
return EAGAIN;
213+
}
214+
210215
emuthread_t *et = (emuthread_t*)box_calloc(1, sizeof(emuthread_t));
211216
x64emu_t *emuthread = NewX64Emu(my_context, (uintptr_t)start_routine, (uintptr_t)stack, stacksize, own);
212217
SetupX64Emu(emuthread, emu);

0 commit comments

Comments
 (0)