瀏覽代碼

* 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 年之前
父節點
當前提交
6a14bb5014
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      compiler/pgenutil.pas

+ 5 - 1
compiler/pgenutil.pas

@@ -765,7 +765,11 @@ uses
                   result:=def;
                   break;
                 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);
           end;