Allow creation of single-byte MCAtoms.

llvm-svn: 184344
This commit is contained in:
Ahmed Bougacha 2013-06-19 20:18:59 +00:00
parent d46fce1141
commit 8a5e10555a
2 changed files with 2 additions and 2 deletions

View File

@ -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(),

View File

@ -126,6 +126,7 @@ void MCObjectDisassembler::buildCFG(MCModule *Module) {
MCTextAtom *TA = dyn_cast<MCTextAtom>(*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<MCTextAtom>(A);
BBInfos[TA->getBeginAddr()].Atom = TA;
if (TA->getBeginAddr() == *SI)
continue;
MCTextAtom *NewAtom = TA->split(*SI);