diff options
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp | 5 | 
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp b/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp index 93ec46df07f..7acd9cc4d30 100644 --- a/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp +++ b/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp @@ -742,8 +742,11 @@ void ARMAsmBackend::applyFixup(const MCFixup &Fixup, char *Data,    // Used to point to big endian bytes.    unsigned FullSizeBytes; -  if (!IsLittleEndian) +  if (!IsLittleEndian) {      FullSizeBytes = getFixupKindContainerSizeBytes(Fixup.getKind()); +    assert((Offset + FullSizeBytes) <= DataSize && "Invalid fixup size!"); +    assert(NumBytes <= FullSizeBytes && "Invalid fixup size!"); +  }    // For each byte of the fragment that the fixup touches, mask in the bits from    // the fixup value. The Value has been "split up" into the appropriate  | 

