[compiler-rt] [win/asan] GetInstructionSize: Fix `8D A4 24 ...` to return rel_offset=3. (PR #119794)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 13 01:58:12 PST 2024
alvinhochun wrote:
If I haven't misunderstood, the point of `rel_offset` is for adjusting an **RIP-relative address** to refer to the same address after the instruction is copied (moved) to a new location for the hotpatch/trampoline hooking techniques.
`[esp + XX XX XX XX]` is an ESP-relative address, which shouldn't need adjustment, so this change looks dubious to me.
Also, considering that on x86 (not x86_64) there is no PC-relative addressing (outside of near jump/call), setting `rel_offset` for any instructions not guarded by `#if SANITIZER_WINDOWS_x64` is probably wrong.
https://github.com/llvm/llvm-project/pull/119794
More information about the llvm-commits
mailing list