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 @@ -232,8 +232,7 @@ SFS_CHECK((guard & (pageSize - 1)) == 0); void *addr = unsafe_stack_alloc(size, guard); - struct tinfo *tinfo = - (struct tinfo *)(((char *)addr) + size - sizeof(struct tinfo)); + struct tinfo *tinfo = reinterpret_cast(addr); tinfo->start_routine = start_routine; tinfo->start_routine_arg = arg; tinfo->unsafe_stack_start = addr;