Browse Source

* 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 years ago
parent
commit
9c0d550320
1 changed files with 14 additions and 1 deletions
  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;