Browse Source

Minor patch: avoid a trap when finding PC and compilation cancels

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@7365 8c9fc860-2736-0410-a75d-ab315db34111
felixf 7 năm trước cách đây
mục cha
commit
d362c8f14e
1 tập tin đã thay đổi với 5 bổ sung3 xóa
  1. 5 3
      source/FoxAMDBackend.Mod

+ 5 - 3
source/FoxAMDBackend.Mod

@@ -3420,9 +3420,11 @@ TYPE
 				Basic.Error(diagnostics, module.module.sourceName,Basic.invalidPosition, " could not locate pc");
 			ELSE
 				binarySection := section(IntermediateCode.Section).resolved;
-				label := binarySection.labels;
-				WHILE (label # NIL) & (label.offset >= sectionOffset) DO
-					label := label.prev;
+				IF binarySection # NIL THEN
+					label := binarySection.labels;
+					WHILE (label # NIL) & (label.offset >= sectionOffset) DO
+						label := label.prev;
+					END;
 				END;
 				IF label # NIL THEN
 					Basic.Information(diagnostics, module.module.sourceName,label.position, " pc position");