Explorar o código

Fixed Generic object file reading and added some assertions.

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@7043 8c9fc860-2736-0410-a75d-ab315db34111
skoster %!s(int64=8) %!d(string=hai) anos
pai
achega
b81bc4fed6
Modificáronse 2 ficheiros con 7 adicións e 2 borrados
  1. 6 2
      source/GenericLinker.Mod
  2. 1 0
      source/ObjectFile.Mod

+ 6 - 2
source/GenericLinker.Mod

@@ -492,9 +492,13 @@ BEGIN
 	requires := NIL;
 	IF version >= 4 THEN
 		IF ~binary THEN 
-			reader.String(string); ObjectFile.ReadNameList(reader, offers, binary, poolMap);
+			reader.String(string); 
+			ASSERT(string = "offers");
+			ObjectFile.ReadNameList(reader, offers, binary, poolMap);
 			reader.SkipWhitespace;
-			reader.String(string); ObjectFile.ReadNameList(reader, requires, binary, poolMap);
+			reader.String(string); 
+			ASSERT(string = "requires");
+			ObjectFile.ReadNameList(reader, requires, binary, poolMap);
 			reader.SkipWhitespace;
 		ELSE
 			ObjectFile.ReadNameList(reader, offers, binary, poolMap);

+ 1 - 0
source/ObjectFile.Mod

@@ -669,6 +669,7 @@ VAR
 				ReadIdentifier(nameList[i]);
 			END;
 		ELSE
+			reader.SkipWhitespace;
 			reader.Int(len,FALSE);
 			NEW(nameList, len);
 			FOR i := 0 TO len-1 DO