Parcourir la source

* fix for Mantis #32118: also provide a range for undefined defs
+ added test

git-svn-id: trunk@36723 -

svenbarth il y a 8 ans
Parent
commit
0c42b6f44a
3 fichiers modifiés avec 24 ajouts et 0 suppressions
  1. 1 0
      .gitattributes
  2. 5 0
      compiler/defutil.pas
  3. 18 0
      tests/webtbs/tw32118.pp

+ 1 - 0
.gitattributes

@@ -15629,6 +15629,7 @@ tests/webtbs/tw3197.pp svneol=native#text/plain
 tests/webtbs/tw3207.pp svneol=native#text/plain
 tests/webtbs/tw3210.pp svneol=native#text/plain
 tests/webtbs/tw32111.pp svneol=native#text/pascal
+tests/webtbs/tw32118.pp svneol=native#text/pascal
 tests/webtbs/tw3212.pp svneol=native#text/plain
 tests/webtbs/tw3214.pp svneol=native#text/plain
 tests/webtbs/tw3216.pp svneol=native#text/plain

+ 5 - 0
compiler/defutil.pas

@@ -1071,6 +1071,11 @@ implementation
               l:=int64(tarraydef(def).lowrange);
               h:=int64(tarraydef(def).highrange);
             end;
+          undefineddef:
+            begin
+              l:=torddef(sizesinttype).low;
+              h:=torddef(sizesinttype).high;
+            end;
           else
             internalerror(200611054);
         end;

+ 18 - 0
tests/webtbs/tw32118.pp

@@ -0,0 +1,18 @@
+{ %NORUN }
+
+program tw32118;
+{$MODE OBJFPC}
+type
+  generic TTestClass<SomeTemplate> = class
+    procedure Test;
+  end;
+
+procedure TTestClass.Test;
+var
+  i : SomeTemplate;
+begin
+  for i := 1 to 10 do WriteLn(i);
+end;
+
+begin
+end.