// 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;
}