diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2010-12-06 19:08:48 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2010-12-06 19:08:48 +0000 |
commit | 179821ac1f282ef6f8d24d5ea346028aee8ba4c7 (patch) | |
tree | 25a5861add458a1bafe0a084a2cdc08827ffc48e /lib/Target/ARM/ARMAsmBackend.cpp | |
parent | c76c59840b7a4491afdcd2f35483f8d6e5ab533a (diff) | |
download | external_llvm-179821ac1f282ef6f8d24d5ea346028aee8ba4c7.tar.gz external_llvm-179821ac1f282ef6f8d24d5ea346028aee8ba4c7.tar.bz2 external_llvm-179821ac1f282ef6f8d24d5ea346028aee8ba4c7.zip |
Remove the instruction fragment to data fragment lowering since it was causing
freed data to be read. I will open a bug to track it being reenabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121028 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/ARMAsmBackend.cpp')
-rw-r--r-- | lib/Target/ARM/ARMAsmBackend.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/Target/ARM/ARMAsmBackend.cpp b/lib/Target/ARM/ARMAsmBackend.cpp index 392a6e6c03..536923e47b 100644 --- a/lib/Target/ARM/ARMAsmBackend.cpp +++ b/lib/Target/ARM/ARMAsmBackend.cpp @@ -138,7 +138,7 @@ public: return Format; } - void ApplyFixup(const MCFixup &Fixup, MCDataFragment &DF, + void ApplyFixup(const MCFixup &Fixup, char *Data, unsigned DataSize, uint64_t Value) const; MCObjectWriter *createObjectWriter(raw_ostream &OS) const { @@ -150,8 +150,8 @@ public: }; // Fixme: Raise this to share code between Darwin and ELF. -void ELFARMAsmBackend::ApplyFixup(const MCFixup &Fixup, MCDataFragment &DF, - uint64_t Value) const { +void ELFARMAsmBackend::ApplyFixup(const MCFixup &Fixup, char *Data, + unsigned DataSize, uint64_t Value) const { // Fixme: 2 for Thumb unsigned NumBytes = 4; Value = adjustFixupValue(Fixup.getKind(), Value); @@ -162,7 +162,7 @@ void ELFARMAsmBackend::ApplyFixup(const MCFixup &Fixup, MCDataFragment &DF, // bits from the fixup value. // The Value has been "split up" into the appropriate bitfields above. for (unsigned i = 0; i != NumBytes; ++i) { - DF.getContents()[Fixup.getOffset() + i] |= uint8_t(Value >> (i * 8)); + Data[Fixup.getOffset() + i] |= uint8_t(Value >> (i * 8)); } } @@ -179,7 +179,7 @@ public: return Format; } - void ApplyFixup(const MCFixup &Fixup, MCDataFragment &DF, + void ApplyFixup(const MCFixup &Fixup, char *Data, unsigned DataSize, uint64_t Value) const; MCObjectWriter *createObjectWriter(raw_ostream &OS) const { @@ -207,17 +207,17 @@ static unsigned getFixupKindNumBytes(unsigned Kind) { } } -void DarwinARMAsmBackend::ApplyFixup(const MCFixup &Fixup, MCDataFragment &DF, - uint64_t Value) const { +void DarwinARMAsmBackend::ApplyFixup(const MCFixup &Fixup, char *Data, + unsigned DataSize, uint64_t Value) const { unsigned NumBytes = getFixupKindNumBytes(Fixup.getKind()); Value = adjustFixupValue(Fixup.getKind(), Value); - assert(Fixup.getOffset() + NumBytes <= DF.getContents().size() && + assert(Fixup.getOffset() + NumBytes <= DataSize && "Invalid fixup offset!"); // For each byte of the fragment that the fixup touches, mask in the // bits from the fixup value. for (unsigned i = 0; i != NumBytes; ++i) - DF.getContents()[Fixup.getOffset() + i] |= uint8_t(Value >> (i * 8)); + Data[Fixup.getOffset() + i] |= uint8_t(Value >> (i * 8)); } } // end anonymous namespace |