Cast up before multiplication

This commit is contained in:
Nobuyoshi Nakada 2023-10-29 21:27:49 +09:00
parent 7f2809b0a9
commit fbd55120f3
No known key found for this signature in database
GPG Key ID: 3582D74E1FEE4465

View File

@ -174,8 +174,8 @@ nt_therad_stack_size(void)
rb_vm_t *vm = GET_VM();
int sz = (int)(vm->default_params.thread_vm_stack_size + vm->default_params.thread_machine_stack_size + MSTACK_PAGE_SIZE);
int page_num = (sz + MSTACK_PAGE_SIZE - 1) / MSTACK_PAGE_SIZE;
msz = page_num * MSTACK_PAGE_SIZE;
int page_num = roomof(sz, MSTACK_PAGE_SIZE);
msz = (size_t)page_num * MSTACK_PAGE_SIZE;
return msz;
}