From: Andreas Sandberg Date: Tue, 9 Jun 2015 13:21:14 +0000 (-0400) Subject: base: Reset CircleBuf size on flush() X-Git-Tag: stable_2015_09_03~7 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=737e5da7f6a4716803e489f473fa4d58579fbd58;p=gem5.git base: Reset CircleBuf size on flush() The flush() method in CircleBuf resets the state of the circular buffer, but fails to set size to zero. This obviously confuses code that tries to determine the amount of data in the buffer. Set the size to zero on flush. --- diff --git a/src/base/circlebuf.cc b/src/base/circlebuf.cc index 06d0075b2..2f04bc16e 100644 --- a/src/base/circlebuf.cc +++ b/src/base/circlebuf.cc @@ -67,6 +67,7 @@ CircleBuf::flush() { _start = 0; _stop = 0; + _size = 0; _rollover = false; }