浏览代码

Fix cycle/build with -al

assemble.pas, TExternalAssembler.WriteSourceLine:
  * don't generate an internal error if no module is found; if the system unit is compiled with -al there can be cases when fileinfo contains only zeros (though I wonder where this comes from; I'll need to investigate this when I have time)

git-svn-id: trunk@23631 -
svenbarth 12 年之前
父节点
当前提交
a68e237450
共有 1 个文件被更改,包括 6 次插入3 次删除
  1. 6 3
      compiler/assemble.pas

+ 6 - 3
compiler/assemble.pas

@@ -716,9 +716,12 @@ Implementation
               module:=current_module
               module:=current_module
             else
             else
               module:=get_module(hp.fileinfo.moduleindex);
               module:=get_module(hp.fileinfo.moduleindex);
-            if not assigned(module) then
-              internalerror(2013021801);
-            infile:=module.sourcefiles.get_file(hp.fileinfo.fileindex);
+            { during the compilation of the system unit there are cases when
+              the fileinfo contains just zeros => invalid }
+            if assigned(module) then
+              infile:=module.sourcefiles.get_file(hp.fileinfo.fileindex)
+            else
+              infile:=nil;
             if assigned(infile) then
             if assigned(infile) then
               begin
               begin
                 { open only if needed !! }
                 { open only if needed !! }