diff --git a/compiler-rt/lib/safestack/safestack.cc b/compiler-rt/lib/safestack/safestack.cc --- a/compiler-rt/lib/safestack/safestack.cc +++ b/compiler-rt/lib/safestack/safestack.cc @@ -228,7 +228,7 @@ } SFS_CHECK(size); - SFS_CHECK((size & (kStackAlign - 1)) == 0); + size = RoundUpTo(size, kStackAlign); SFS_CHECK((guard & (pageSize - 1)) == 0); void *addr = unsafe_stack_alloc(size, guard);