Fix fixPacket functionality to calculate sizes properly

src/mem/packet.cc:
    Copy size is calculated by END-BEGIN not BEGIN-END

--HG--
extra : convert_revision : 0e2725c5551f8f70ff05cb285e0822afc0bb3f87
This commit is contained in:
Ron Dreslinski 2006-10-25 14:14:37 -04:00
parent 86bd01dfc9
commit eda7148af2

View file

@ -182,11 +182,11 @@ fixPacket(PacketPtr func, PacketPtr timing)
if (funcStart >= timingStart) {
memcpy(timing->getPtr<uint8_t>() + (funcStart - timingStart),
func->getPtr<uint8_t>(),
funcStart - std::min(funcEnd, timingEnd));
std::min(funcEnd, timingEnd) - funcStart);
} else { // timingStart > funcStart
memcpy(timing->getPtr<uint8_t>(),
func->getPtr<uint8_t>() + (timingStart - funcStart),
timingStart - std::min(funcEnd, timingEnd));
std::min(funcEnd, timingEnd) - timingStart);
}
// we always want to keep going with a write
return true;