From 7ab184a2a1cbf5b5b340d663e07550659438ed7c Mon Sep 17 00:00:00 2001 From: Ahmed Bougacha Date: Wed, 19 Jun 2013 20:18:59 +0000 Subject: [PATCH] Allow creation of single-byte MCAtoms. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184344 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/MC/MCModule.cpp | 2 +- lib/MC/MCObjectDisassembler.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/MC/MCModule.cpp b/lib/MC/MCModule.cpp index 17619d9392e..5890b4bd028 100644 --- a/lib/MC/MCModule.cpp +++ b/lib/MC/MCModule.cpp @@ -21,7 +21,7 @@ static bool AtomComp(const MCAtom *L, uint64_t Addr) { void MCModule::map(MCAtom *NewAtom) { uint64_t Begin = NewAtom->Begin; - assert(Begin < NewAtom->End && "Creating MCAtom with endpoints reversed?"); + assert(Begin <= NewAtom->End && "Creating MCAtom with endpoints reversed?"); // Check for atoms already covering this range. AtomListTy::iterator I = std::lower_bound(atom_begin(), atom_end(), diff --git a/lib/MC/MCObjectDisassembler.cpp b/lib/MC/MCObjectDisassembler.cpp index bb3de1779e1..1ea6eed3078 100644 --- a/lib/MC/MCObjectDisassembler.cpp +++ b/lib/MC/MCObjectDisassembler.cpp @@ -126,6 +126,7 @@ void MCObjectDisassembler::buildCFG(MCModule *Module) { MCTextAtom *TA = dyn_cast(*AI); if (!TA) continue; Calls.insert(TA->getBeginAddr()); + BBInfos[TA->getBeginAddr()].Atom = TA; for (MCTextAtom::const_iterator II = TA->begin(), IE = TA->end(); II != IE; ++II) { if (MIA.isTerminator(II->Inst)) @@ -145,7 +146,6 @@ void MCObjectDisassembler::buildCFG(MCModule *Module) { MCAtom *A = Module->findAtomContaining(*SI); if (!A) continue; MCTextAtom *TA = cast(A); - BBInfos[TA->getBeginAddr()].Atom = TA; if (TA->getBeginAddr() == *SI) continue; MCTextAtom *NewAtom = TA->split(*SI);