浏览代码

* fix for Mantis #30530: when the global/static symtable is reached defowner is Nil, so respect that in the loop condition
+ added test

git-svn-id: trunk@34532 -

svenbarth 8 年之前
父节点
当前提交
ce18b10c81
共有 3 个文件被更改,包括 20 次插入1 次删除
  1. 1 0
      .gitattributes
  2. 1 1
      compiler/symtable.pas
  3. 18 0
      tests/webtbs/tw30530.pp

+ 1 - 0
.gitattributes

@@ -15224,6 +15224,7 @@ tests/webtbs/tw30443.pp svneol=native#text/plain
 tests/webtbs/tw3045.pp svneol=native#text/plain
 tests/webtbs/tw3048.pp svneol=native#text/plain
 tests/webtbs/tw30522.pp svneol=native#text/plain
+tests/webtbs/tw30530.pp svneol=native#text/pascal
 tests/webtbs/tw30534.pp svneol=native#text/pascal
 tests/webtbs/tw30537.pp svneol=native#text/pascal
 tests/webtbs/tw30570.pp svneol=native#text/plain

+ 1 - 1
compiler/symtable.pas

@@ -2830,7 +2830,7 @@ implementation
               exit;
             end;
           def:=tdef(def.owner.defowner);
-        until not (def.typ in [recorddef,objectdef]);
+        until not assigned(def) or not (def.typ in [recorddef,objectdef]);
         result:=nil;
       end;
 

+ 18 - 0
tests/webtbs/tw30530.pp

@@ -0,0 +1,18 @@
+unit tw30530;
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+  {Classes, SysUtils, }Generics.Collections;
+
+type
+
+  //generic TMyList<T> = class(specialize TObjectList<T>);
+  generic TMyList<T: class> = class(specialize TObjectList<T>);
+  //generic TMyList<T: class> = class(specialize TObjectList<T>) end;
+
+implementation
+
+end.