[llvm] r188873 - MC CFG: Remap enough for the inserted instruction.

Ahmed Bougacha ahmed.bougacha at gmail.com
Wed Aug 21 00:27:47 PDT 2013


Author: ab
Date: Wed Aug 21 02:27:47 2013
New Revision: 188873

URL: http://llvm.org/viewvc/llvm-project?rev=188873&view=rev
Log:
MC CFG: Remap enough for the inserted instruction.

Modified:
    llvm/trunk/lib/MC/MCAtom.cpp

Modified: llvm/trunk/lib/MC/MCAtom.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAtom.cpp?rev=188873&r1=188872&r2=188873&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCAtom.cpp (original)
+++ llvm/trunk/lib/MC/MCAtom.cpp Wed Aug 21 02:27:47 2013
@@ -72,8 +72,8 @@ MCDataAtom *MCDataAtom::split(uint64_t S
 // 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;
 }





More information about the llvm-commits mailing list