[all-commits] [llvm/llvm-project] a8f36c: [AArch64] Check Subtarget via STI in getInstSizeIn...
Zachary Yedidia via All-commits
all-commits at lists.llvm.org
Tue Apr 14 10:59:41 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: a8f36ccb2a24ef4abcbff58b2f36ce2deacefd54
https://github.com/llvm/llvm-project/commit/a8f36ccb2a24ef4abcbff58b2f36ce2deacefd54
Author: Zachary Yedidia <zyedidia at gmail.com>
Date: 2026-04-14 (Tue, 14 Apr 2026)
Changed paths:
M llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
Log Message:
-----------
[AArch64] Check Subtarget via STI in getInstSizeInBytes (#192089)
The InstSizes test (`llvm/unittests/Target/AArch64/InstSizes.cpp`)
destroys the Subtarget field early (`ST` created on the stack in
[`createInstrInfo`](https://github.com/llvm/llvm-project/blob/40a585e742ed6b28306d7511380079325ba1a003/llvm/unittests/Target/AArch64/InstSizes.cpp#L32)),
causing a use-after-free if it is used in `getInstSizeInBytes`. This
causes a failure when running the test with hwasan (reported by build
bot). To fix this, this PR switches to using `STI` instead of
`Subtarget` in `getInstSizeInBytes` for checking `isLFI`, which survives
for the lifetime of the test.
I think fixing the test itself (the root of the issue, as far as I can
tell) would be more involved. Perhaps I should open an issue for it
though?
I have tested the fix on an AArch64 machine with hwasan to confirm that
it resolves the issue.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list