Browse Source

* fixed bug #1096 (merged)

peter 25 years ago
parent
commit
bd6d4c3d17
2 changed files with 15 additions and 7 deletions
  1. 7 3
      compiler/pstatmnt.pas
  2. 8 4
      compiler/tcflw.pas

+ 7 - 3
compiler/pstatmnt.pas

@@ -717,7 +717,8 @@ unit pstatmnt;
          else
          else
            p:=nil;
            p:=nil;
          p:=gensinglenode(exitn,p);
          p:=gensinglenode(exitn,p);
-         p^.resulttype:=procinfo^.returntype.def;
+         // p^.resulttype:=procinfo^.returntype.def;
+         p^.resulttype:=voiddef;
          exit_statement:=p;
          exit_statement:=p;
       end;
       end;
 
 
@@ -1381,7 +1382,10 @@ unit pstatmnt;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.4  2000-08-12 06:46:06  florian
+  Revision 1.5  2000-08-12 15:41:15  peter
+    * fixed bug 1096 (merged)
+
+  Revision 1.4  2000/08/12 06:46:06  florian
     + case statement for int64/qword implemented
     + case statement for int64/qword implemented
 
 
   Revision 1.3  2000/07/13 12:08:27  michael
   Revision 1.3  2000/07/13 12:08:27  michael
@@ -1390,4 +1394,4 @@ end.
   Revision 1.2  2000/07/13 11:32:45  michael
   Revision 1.2  2000/07/13 11:32:45  michael
   + removed logs
   + removed logs
 
 
-}
+}

+ 8 - 4
compiler/tcflw.pas

@@ -386,6 +386,7 @@ implementation
       var
       var
          pt : ptree;
          pt : ptree;
       begin
       begin
+         p^.resulttype:=voiddef;
          if assigned(p^.left) then
          if assigned(p^.left) then
            begin
            begin
               firstpass(p^.left);
               firstpass(p^.left);
@@ -393,12 +394,12 @@ implementation
               if codegenerror then
               if codegenerror then
                exit;
                exit;
               { Check the 2 types }
               { Check the 2 types }
-              p^.left:=gentypeconvnode(p^.left,p^.resulttype);
+              p^.left:=gentypeconvnode(p^.left,procinfo^.returntype.def);
               firstpass(p^.left);
               firstpass(p^.left);
-              if ret_in_param(p^.resulttype) or procinfo^.no_fast_exit then
+              if ret_in_param(procinfo^.returntype.def) or procinfo^.no_fast_exit then
                 begin
                 begin
                   pt:=genzeronode(funcretn);
                   pt:=genzeronode(funcretn);
-                  pt^.rettype.setdef(p^.resulttype);
+                  pt^.rettype.setdef(procinfo^.returntype.def);
                   pt^.funcretprocinfo:=procinfo;
                   pt^.funcretprocinfo:=procinfo;
                   p^.left:=gennode(assignn,pt,p^.left);
                   p^.left:=gennode(assignn,pt,p^.left);
                   firstpass(p^.left);
                   firstpass(p^.left);
@@ -634,7 +635,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.3  2000-08-02 07:04:56  jonas
+  Revision 1.4  2000-08-12 15:41:15  peter
+    * fixed bug 1096 (merged)
+
+  Revision 1.3  2000/08/02 07:04:56  jonas
     * fixed crash when an undeclared identifier is used in a raise statement
     * fixed crash when an undeclared identifier is used in a raise statement
       (merged from fixes branch)
       (merged from fixes branch)