summaryrefslogtreecommitdiff
path: root/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2025-08-01 00:31:51 -0700
committerFangrui Song <i@maskray.me>2025-08-01 00:31:51 -0700
commit491c7bdd5887ea4561b6cbfc07a8ca4a140e871d (patch)
treec4ca479e3b0aaa6f124334ac9fc52554b3a12e14 /llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
parent228e96b28a84828e1720c387a339a7e68dbdc029 (diff)
MCAsmBackend::applyFixup: Replace Data.getSize() with F.getSize()
to facilitate replacing `MutableArrayRef<char> Data` (fragment content) with the relocated location. This is necessary to fix the pointer-overflow sanitizer issue and reland #150846
Diffstat (limited to 'llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp')
-rw-r--r--llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp b/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
index 146fc6704c6d..dfa3de3c3ade 100644
--- a/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
+++ b/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
@@ -1125,7 +1125,7 @@ void ARMAsmBackend::applyFixup(const MCFragment &F, const MCFixup &Fixup,
const unsigned NumBytes = getFixupKindNumBytes(Kind);
unsigned Offset = Fixup.getOffset();
- assert(Offset + NumBytes <= Data.size() && "Invalid fixup offset!");
+ assert(Offset + NumBytes <= F.getSize() && "Invalid fixup offset!");
// Used to point to big endian bytes.
unsigned FullSizeBytes;