Browse Source

* warn if uninitilized local vars are used in IS or AS statements

pierre 26 years ago
parent
commit
6ca3c0ee87
1 changed files with 14 additions and 2 deletions
  1. 14 2
      compiler/tccnv.pas

+ 14 - 2
compiler/tccnv.pas

@@ -853,10 +853,14 @@ implementation
 *****************************************************************************}
 *****************************************************************************}
 
 
     procedure firstis(var p : ptree);
     procedure firstis(var p : ptree);
-
+      var
+         Store_valid : boolean;
       begin
       begin
+         Store_valid:=Must_be_valid;
+         Must_be_valid:=true;
          firstpass(p^.left);
          firstpass(p^.left);
          firstpass(p^.right);
          firstpass(p^.right);
+         Must_be_valid:=Store_valid;
          if codegenerror then
          if codegenerror then
            exit;
            exit;
 
 
@@ -887,9 +891,14 @@ implementation
 *****************************************************************************}
 *****************************************************************************}
 
 
     procedure firstas(var p : ptree);
     procedure firstas(var p : ptree);
+      var
+         Store_valid : boolean;
       begin
       begin
+         Store_valid:=Must_be_valid;
+         Must_be_valid:=true;
          firstpass(p^.right);
          firstpass(p^.right);
          firstpass(p^.left);
          firstpass(p^.left);
+         Must_be_valid:=Store_valid;
          if codegenerror then
          if codegenerror then
            exit;
            exit;
 
 
@@ -918,7 +927,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.21  1999-03-06 17:25:20  peter
+  Revision 1.22  1999-04-08 09:47:31  pierre
+   * warn if uninitilized local vars are used in IS or AS statements
+
+  Revision 1.21  1999/03/06 17:25:20  peter
     * moved comp<->real warning so it doesn't occure everytime that
     * moved comp<->real warning so it doesn't occure everytime that
       isconvertable is called with
       isconvertable is called with