Browse Source

* better uninitialized var tests for TP mode

pierre 26 years ago
parent
commit
a5305b32ee
1 changed files with 12 additions and 3 deletions
  1. 12 3
      compiler/pstatmnt.pas

+ 12 - 3
compiler/pstatmnt.pas

@@ -808,12 +808,18 @@ unit pstatmnt;
                 tt:=hdisposen;
                 tt:=hdisposen;
             end;
             end;
           consume(LKLAMMER);
           consume(LKLAMMER);
+
+          { displaced here to avoid warnings in BP mode (PM) }
+          Store_valid := Must_be_valid;
+          if tt=hnewn then
+            Must_be_valid := False
+          else
+            Must_be_valid:=true;
+
           p:=comp_expr(true);
           p:=comp_expr(true);
 
 
           { calc return type }
           { calc return type }
           cleartempgen;
           cleartempgen;
-          Store_valid := Must_be_valid;
-          Must_be_valid := False;
           do_firstpass(p);
           do_firstpass(p);
           Must_be_valid := Store_valid;
           Must_be_valid := Store_valid;
 
 
@@ -1265,7 +1271,10 @@ unit pstatmnt;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.87  1999-05-27 19:44:50  peter
+  Revision 1.88  1999-06-15 13:19:46  pierre
+   * better uninitialized var tests for TP mode
+
+  Revision 1.87  1999/05/27 19:44:50  peter
     * removed oldasm
     * removed oldasm
     * plabel -> pasmlabel
     * plabel -> pasmlabel
     * -a switches to source writing automaticly
     * -a switches to source writing automaticly