summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC
diff options
context:
space:
mode:
authorAhmed Bougacha <ahmed.bougacha@gmail.com>2013-08-21 07:27:47 +0000
committerAhmed Bougacha <ahmed.bougacha@gmail.com>2013-08-21 07:27:47 +0000
commitc43aa4e88c4439a9ef28425189ad31bc74007bcf (patch)
tree53e3520845a729660db4632b3bfc12372768fb1a /llvm/lib/MC
parent03efde5887f04c48a7a73f08557fffb39cd42cea (diff)
downloadbcm5719-llvm-c43aa4e88c4439a9ef28425189ad31bc74007bcf.tar.gz
bcm5719-llvm-c43aa4e88c4439a9ef28425189ad31bc74007bcf.zip
MC CFG: Remap enough for the inserted instruction.
llvm-svn: 188873
Diffstat (limited to 'llvm/lib/MC')
-rw-r--r--llvm/lib/MC/MCAtom.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/MC/MCAtom.cpp b/llvm/lib/MC/MCAtom.cpp
index 2626b39db4c..f3ea6c344d8 100644
--- a/llvm/lib/MC/MCAtom.cpp
+++ b/llvm/lib/MC/MCAtom.cpp
@@ -72,8 +72,8 @@ MCDataAtom *MCDataAtom::split(uint64_t SplitPt) {
// MCTextAtom
void MCTextAtom::addInst(const MCInst &I, uint64_t Size) {
- if (NextInstAddress > End)
- remap(Begin, NextInstAddress);
+ if (NextInstAddress + Size - 1 > End)
+ remap(Begin, NextInstAddress + Size - 1);
Insts.push_back(MCDecodedInst(I, NextInstAddress, Size));
NextInstAddress += Size;
}
OpenPOWER on IntegriCloud