Browse Source

* check the owner of current_specializedef as that is Nil if a generic routine is specialized and this is the specialization of one of its parameters or its result type

git-svn-id: trunk@34411 -
svenbarth 9 years ago
parent
commit
6a14bb5014
1 changed files with 5 additions and 1 deletions
  1. 5 1
      compiler/pgenutil.pas

+ 5 - 1
compiler/pgenutil.pas

@@ -765,7 +765,11 @@ uses
                   result:=def;
                   result:=def;
                   break;
                   break;
                 end;
                 end;
-              def:=tstoreddef(def.owner.defowner);
+              if assigned(def.owner) then
+                def:=tstoreddef(def.owner.defowner)
+              else
+                { this can happen when specializing a generic function }
+                def:=nil;
             until not assigned(def) or not (df_specialization in def.defoptions);
             until not assigned(def) or not (df_specialization in def.defoptions);
           end;
           end;