summaryrefslogtreecommitdiff
path: root/lang/mozart/files/patch-platform-emulator-componentBuffer.cc
blob: fe91c1858b60a907e59baf69f0f0019db8f4144c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
--- ./platform/emulator/componentBuffer.cc.orig	Mon Mar 11 19:31:50 2002
+++ ./platform/emulator/componentBuffer.cc	Sat Sep  3 18:46:09 2005
@@ -13,8 +13,8 @@
  *    Konstantin Popov 2001
  * 
  *  Last change:
- *    $Date: 2002/03/12 00:31:50 $ by $Author: popow $
- *    $Revision: 1.29 $
+ *    $Date: 2004/08/11 14:49:03 $ by $Author: popow $
+ *    $Revision: 1.29.12.1 $
  * 
  *  This file is part of Mozart, an implementation 
  *  of Oz 3:
@@ -277,7 +277,12 @@
 {
   Assert(pbState == PB_Unmarshal);
   DebugCode(pbState = PB_None;);
-  Assert(posMB == last->head() + lastChunkSize);
+  // If zero bytes where read in the last chunk (or, differently put,
+  // the last non-empty chunk was full) - then that last chunk will
+  // never be reached, so 'posMB' will never point to it - because
+  // 'getNext()' advances 'posMB' to a next buffer only when it is
+  // really necessary.
+  Assert(lastChunkSize == 0 || posMB == last->head() + lastChunkSize);
   DebugCode(posMB = (BYTE *) -1;);
   DebugCode(endMB = (BYTE *) -1;);
 }