Change-Id: I376154cfc825234cdee1788affc9c1a972e6c0c0
This commit is contained in:
abnormalmaps
2025-09-24 09:48:41 -04:00
parent 58b66ae345
commit 383259bdcc
2 changed files with 2 additions and 2 deletions

View File

@@ -110,7 +110,7 @@ pub fn pthread_attr_setstacksize(
attr: MutPtr<pthread_attr_t>,
stacksize: GuestUSize,
) -> i32 {
if attr.is_null() || stacksize < PTHREAD_STACK_MIN || stacksize.is_multiple_of(PAGE_SIZE) {
if attr.is_null() || stacksize < PTHREAD_STACK_MIN || !stacksize.is_multiple_of(PAGE_SIZE) {
return EINVAL;
}
check_magic!(env, attr, MAGIC_ATTR);

View File

@@ -334,7 +334,7 @@ impl Allocator {
}
fn align(size: GuestUSize, align: GuestUSize) -> GuestUSize {
if size.is_multiple_of(align) {
if !size.is_multiple_of(align) {
size + align - (size % align)
} else {
size