Selaa lähdekoodia

* fix for #36554

git-svn-id: trunk@43913 -
florian 5 vuotta sitten
vanhempi
commit
007df5d0fa
3 muutettua tiedostoa jossa 20 lisäystä ja 1 poistoa
  1. 1 0
      .gitattributes
  2. 4 1
      compiler/pstatmnt.pas
  3. 15 0
      tests/webtbf/tw36554.pp

+ 1 - 0
.gitattributes

@@ -16118,6 +16118,7 @@ tests/webtbf/tw36377.pp svneol=native#text/pascal
 tests/webtbf/tw36397.pp -text svneol=native#text/pascal
 tests/webtbf/tw36397.pp -text svneol=native#text/pascal
 tests/webtbf/tw3643.pp svneol=native#text/plain
 tests/webtbf/tw3643.pp svneol=native#text/plain
 tests/webtbf/tw3644.pp svneol=native#text/plain
 tests/webtbf/tw3644.pp svneol=native#text/plain
+tests/webtbf/tw36554.pp svneol=native#text/pascal
 tests/webtbf/tw3662.pp svneol=native#text/plain
 tests/webtbf/tw3662.pp svneol=native#text/plain
 tests/webtbf/tw3680.pp svneol=native#text/plain
 tests/webtbf/tw3680.pp svneol=native#text/plain
 tests/webtbf/tw3716.pp svneol=native#text/plain
 tests/webtbf/tw3716.pp svneol=native#text/plain

+ 4 - 1
compiler/pstatmnt.pas

@@ -385,7 +385,10 @@ implementation
                ) and
                ) and
                (hloopvar.resultdef.typ<>undefineddef)
                (hloopvar.resultdef.typ<>undefineddef)
                then
                then
-               MessagePos(hloopvar.fileinfo,type_e_ordinal_expr_expected);
+               begin
+                 MessagePos(hloopvar.fileinfo,type_e_ordinal_expr_expected);
+                 hloopvar.resultdef:=generrordef;
+               end;
 
 
              hp:=hloopvar;
              hp:=hloopvar;
              while assigned(hp) and
              while assigned(hp) and

+ 15 - 0
tests/webtbf/tw36554.pp

@@ -0,0 +1,15 @@
+{ %fail }
+type oWord = record q1,q2 : qword; end;
+
+procedure megadoodoo;
+var a : oWord;
+
+begin
+     for a:=0 to 3 do
+     begin
+     end;
+end;
+
+
+begin
+end.