소스 검색

* only read the first OMF record in TOmfLibObjectWriter.closefile, since we no
longer copy the entire file there, so we parse the file only to get the module
name, and the THEADR record should always be the first record in the OMF file.

git-svn-id: trunk@39198 -

nickysn 7 년 전
부모
커밋
188e9ff64a
1개의 변경된 파일11개의 추가작업 그리고 11개의 파일을 삭제
  1. 11 11
      compiler/owomflib.pas

+ 11 - 11
compiler/owomflib.pas

@@ -227,17 +227,17 @@ implementation
       begin
       begin
         FCurrentModule.ObjData.seek(0);
         FCurrentModule.ObjData.seek(0);
         RawRec:=TOmfRawRecord.Create;
         RawRec:=TOmfRawRecord.Create;
-        repeat
-          RawRec.ReadFrom(FCurrentModule.ObjData);
-          if RawRec.RecordType=RT_THEADR then
-            begin
-              ObjHeader:=TOmfRecord_THEADR.Create;
-              ObjHeader.DecodeFrom(RawRec);
-              { create a dictionary entry with the module name }
-              TOmfLibDictionaryEntry.Create(FDictionary,ModName2DictEntry(ObjHeader.ModuleName),FCurrentModuleIndex);
-              ObjHeader.Free;
-            end;
-        until RawRec.RecordType in [RT_MODEND,RT_MODEND32];
+        RawRec.ReadFrom(FCurrentModule.ObjData);
+        if RawRec.RecordType<>RT_THEADR then
+          begin
+            RawRec.Free;
+            InternalError(2018060801);
+          end;
+        ObjHeader:=TOmfRecord_THEADR.Create;
+        ObjHeader.DecodeFrom(RawRec);
+        { create a dictionary entry with the module name }
+        TOmfLibDictionaryEntry.Create(FDictionary,ModName2DictEntry(ObjHeader.ModuleName),FCurrentModuleIndex);
+        ObjHeader.Free;
         RawRec.Free;
         RawRec.Free;
         fobjsize:=0;
         fobjsize:=0;
       end;
       end;