Skip to content

Commit

Permalink
clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
ndrewh committed Dec 27, 2024
1 parent 9e81c16 commit 9d52c65
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 4 additions & 2 deletions suite/tests/linux/mangle_pauth.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ handle_signal(int signal, siginfo_t *siginfo, ucontext_t *ucxt)
* We need to strip the PAC from from the fault address to canonicalize it and
* compare it to the expected branch target address.
*/
const uintptr_t pc = IF_MACOS_ELSE(ucxt->uc_mcontext->__ss.__pc, ucxt->uc_mcontext.pc);
const uintptr_t pc =
IF_MACOS_ELSE(ucxt->uc_mcontext->__ss.__pc, ucxt->uc_mcontext.pc);
const uintptr_t fault_pc = strip_pac(pc);
LOG(" ucxt->uc_mcontext.pc = " PFX "\n", pc);
LOG(" fault_pc = " PFX "\n", fault_pc);
Expand All @@ -124,7 +125,8 @@ handle_signal(int signal, siginfo_t *siginfo, ucontext_t *ucxt)
/* CPU has FEAT_FPACCOMBINE so the branch instruction generated an authentication
* failure exception and the fault PC should match the branch instruction address.
*/
const uintptr_t fault_pc = IF_MACOS_ELSE(ucxt->uc_mcontext->__ss.__pc, ucxt->uc_mcontext.pc);
const uintptr_t fault_pc =
IF_MACOS_ELSE(ucxt->uc_mcontext->__ss.__pc, ucxt->uc_mcontext.pc);
LOG(" fault_pc = " PFX "\n", fault_pc);
LOG(" branch_instr_addr = " PFX "\n", branch_instr_addr);
if (fault_pc == branch_instr_addr)
Expand Down
8 changes: 4 additions & 4 deletions suite/tests/tools.c
Original file line number Diff line number Diff line change
Expand Up @@ -506,9 +506,9 @@ intercept_signal(int sig, handler_3_t handler, bool sigstack)
void
dump_ucontext(ucontext_t *ucxt, bool is_sve, int vl_bytes)
{
#ifdef MACOS
# ifdef MACOS
assert(false); /* NYI */
#else
# else
struct _aarch64_ctx *head = (struct _aarch64_ctx *)(ucxt->uc_mcontext64.__reserved);
assert(head->magic == FPSIMD_MAGIC);
assert(head->size == sizeof(struct fpsimd_context));
Expand All @@ -524,7 +524,7 @@ dump_ucontext(ucontext_t *ucxt, bool is_sve, int vl_bytes)
}
print("\n");

# ifndef DR_HOST_NOT_TARGET
# ifndef DR_HOST_NOT_TARGET
if (is_sve) {
size_t offset = sizeof(struct fpsimd_context);
struct _aarch64_ctx *next_head =
Expand Down Expand Up @@ -604,8 +604,8 @@ dump_ucontext(ucontext_t *ucxt, bool is_sve, int vl_bytes)
next_head = (struct _aarch64_ctx *)(ucxt->uc_mcontext.RESERVED + offset);
}
}
# endif
# endif
#endif
}
# endif

Expand Down

0 comments on commit 9d52c65

Please sign in to comment.