瀏覽代碼

* immediately register interface defs so their defid cannot vary depending
on the implementation (which would change the interface crc, even though
the interface didn't change)

git-svn-id: trunk@32171 -

Jonas Maebe 9 年之前
父節點
當前提交
9c0d550320
共有 1 個文件被更改,包括 14 次插入1 次删除
  1. 14 1
      compiler/symdef.pas

+ 14 - 1
compiler/symdef.pas

@@ -1675,7 +1675,20 @@ implementation
            exit;
          { Register in symtable stack }
          if doregister then
-           maybe_put_in_symtable_stack;
+           begin
+             { immediately register interface defs, as they will always be
+               written to the ppu, their defid inlfuences the interface crc and
+               if we wait, depending on e.g. compiler defines they may get a
+               different defid (e.g. when a function is called, its procdef is
+               registered, so depending on whether or not, or when, an interface
+               procedure is called in the implementation, that may change its
+               defid otherwise) }
+             if assigned(current_module) and
+                current_module.in_interface then
+               register_def
+             else
+               maybe_put_in_symtable_stack;
+           end;
       end;