[PATCH] D145205: [codegen][riscv] Emit CFI directives when using shadow call stack
Roland McGrath via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 6 11:32:43 PST 2023
mcgrathr accepted this revision.
mcgrathr added inline comments.
This revision is now accepted and ready to land.
================
Comment at: llvm/lib/Target/RISCV/RISCVFrameLowering.cpp:83
+ uint8_t Offset;
+ encodeSLEB128(-SlotSize, &Offset);
+ // Emit a CFI instruction that causes SlotSize to be subtracted from the value
----------------
This is only safe to do with a one-byte buffer since you know the value fits.
It should at the very least have an assertion that `encodeSLEB128` returned 1.
But just using `-SlotSize & 0x7f` would be more clearly safe.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D145205/new/
https://reviews.llvm.org/D145205
More information about the llvm-commits
mailing list