[asan/mac] Fix remaining -Wformat warnings
AARCH64_GET_REG() is used to initialize uptrs, and after D79132 the ptrauth branch of its implementation explicitly casts to uptr. The non-ptrauth branch returns ucontext->uc_mcontext->__ss.__fp (etc), which has either type void* or __uint64_t (ref usr/include/mach/arm/_structs.h) where __uint64_t is a unsigned long long (ref usr/include/arm/_types.h). uptr is an unsigned long (ref compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h). So explicitly cast to uptr in this branch as well, so that AARCH64_GET_REG() has a well-defined type. Then change DUMPREGA64() tu use %lx instead of %llx since that's the right type for uptr. (Most other places in compiler-rt print uptrs as %p and cast the arg to (void*), but there are explicit 0x%016 format strings in the surroundings, so be locally consistent with that.) No behavior change, in the end it's just 64-bit unsigneds by slightly different names.
Loading
Please sign in to comment