Bläddra i källkod

* do not throw an internal error later on in case of a recursive call, if the declaration of the function was faulty, resolves #37460

git-svn-id: trunk@45975 -
florian 5 år sedan
förälder
incheckning
6f661e44d0
3 ändrade filer med 12 tillägg och 1 borttagningar
  1. 1 0
      .gitattributes
  2. 6 1
      compiler/x86_64/cpupara.pas
  3. 5 0
      tests/webtbf/tw37460.pp

+ 1 - 0
.gitattributes

@@ -16541,6 +16541,7 @@ tests/webtbf/tw37272b.pp svneol=native#text/pascal
 tests/webtbf/tw37303.pp -text svneol=native#text/pascal
 tests/webtbf/tw3738.pp svneol=native#text/plain
 tests/webtbf/tw3740.pp svneol=native#text/plain
+tests/webtbf/tw37460.pp svneol=native#text/pascal
 tests/webtbf/tw3790.pp svneol=native#text/plain
 tests/webtbf/tw3812.pp svneol=native#text/plain
 tests/webtbf/tw3930a.pp svneol=native#text/plain

+ 6 - 1
compiler/x86_64/cpupara.pas

@@ -1454,7 +1454,12 @@ unit cpupara;
             numclasses:=classify_argument(p.proccalloption,result.def,nil,vs_value,result.def.size,classes,0,False);
             { this would mean a memory return }
             if (numclasses=0) then
-              internalerror(2010021502);
+              begin
+                { we got an error before, so we just skip all the return type generation }
+                if result.def.typ=errordef then
+                  exit;
+                internalerror(2010021502);
+              end;
 
             if (numclasses > MAX_PARA_CLASSES) then
               internalerror(2010021503);

+ 5 - 0
tests/webtbf/tw37460.pp

@@ -0,0 +1,5 @@
+{ %fail }
+function x(x : real) : ;
+begin
+  tmp in [x div x(1)]
+end.