summaryrefslogtreecommitdiff
path: root/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
commit3ec498faad21e4e6aac5af2b5a3f8e244bd6d874 (patch)
tree80f633c5e4bae80b03db7ea08aac9de2fc4596bf /lib/MC
parente0511ded947bc9a63608b94909da888e97a0b4e4 (diff)
downloadllvm-3ec498faad21e4e6aac5af2b5a3f8e244bd6d874.tar.gz
llvm-3ec498faad21e4e6aac5af2b5a3f8e244bd6d874.tar.bz2
llvm-3ec498faad21e4e6aac5af2b5a3f8e244bd6d874.tar.xz
MC CFG: Remap enough for the inserted instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188873 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC')
-rw-r--r--lib/MC/MCAtom.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/MC/MCAtom.cpp b/lib/MC/MCAtom.cpp
index 2626b39db4..f3ea6c344d 100644
--- a/lib/MC/MCAtom.cpp
+++ b/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;
}