DEADSOFTWARE

Read NIL stores correctly
authorGert van Valkenhoef <g.h.m.van.valkenhoef@rug.nl>
Fri, 12 Aug 2011 16:32:50 +0000 (18:32 +0200)
committerGert van Valkenhoef <g.h.m.van.valkenhoef@rug.nl>
Fri, 12 Aug 2011 16:32:50 +0000 (18:32 +0200)
reader.cc

index 1f60ce8fe31041fda6ebb15c5f740ed5022bf474..f53e30a8e896035d8a769d2de4cf10b27c9e8d33 100644 (file)
--- a/reader.cc
+++ b/reader.cc
@@ -120,6 +120,14 @@ Store* Reader::readStore() {
 //                     kind: SHORTCHAR; path: TypePath; type: TypeName;
 //                     save: ReaderState;
 Store *Reader::readNilStore() {
+       INTEGER comment = readInt();
+       std::streamoff next = readInt();
+       d_state->end = d_rider.tellg();
+       if (next > 0 || (next == 0 && comment % 2 == 1)) {
+               d_state->next = d_state->end + next;
+       } else {
+               d_state->next = 0;
+       }
        return 0;
 }
 //             IF kind = nil THEN