summaryrefslogtreecommitdiff
path: root/dev/pktfifo.hh
diff options
context:
space:
mode:
Diffstat (limited to 'dev/pktfifo.hh')
-rw-r--r--dev/pktfifo.hh6
1 files changed, 4 insertions, 2 deletions
diff --git a/dev/pktfifo.hh b/dev/pktfifo.hh
index 61e4ead1b..e63fd291f 100644
--- a/dev/pktfifo.hh
+++ b/dev/pktfifo.hh
@@ -113,8 +113,10 @@ class PacketFifo
{
PacketPtr &packet = *i;
if (i != fifo.begin()) {
- --i;
- (*i)->slack += packet->length;
+ iterator prev = i;
+ --prev;
+ assert(prev != fifo.end());
+ (*prev)->slack += packet->length;
} else {
_size -= packet->length;
_size -= packet->slack;