2
0
Эх сурвалжийг харах

* warn when doing not(uninitialised_variable)

git-svn-id: trunk@6000 -
Jonas Maebe 18 жил өмнө
parent
commit
7f24462fcb

+ 1 - 0
.gitattributes

@@ -5664,6 +5664,7 @@ tests/tbf/tb0191.pp svneol=native#text/plain
 tests/tbf/tb0192.pp svneol=native#text/plain
 tests/tbf/tb0192.pp svneol=native#text/plain
 tests/tbf/tb0193.pp svneol=native#text/plain
 tests/tbf/tb0193.pp svneol=native#text/plain
 tests/tbf/tb0194.pp svneol=native#text/plain
 tests/tbf/tb0194.pp svneol=native#text/plain
+tests/tbf/tb0195.pp svneol=native#text/plain
 tests/tbf/ub0115.pp svneol=native#text/plain
 tests/tbf/ub0115.pp svneol=native#text/plain
 tests/tbf/ub0149.pp svneol=native#text/plain
 tests/tbf/ub0149.pp svneol=native#text/plain
 tests/tbf/ub0158a.pp svneol=native#text/plain
 tests/tbf/ub0158a.pp svneol=native#text/plain

+ 1 - 1
compiler/nmat.pas

@@ -859,7 +859,7 @@ implementation
       begin
       begin
          result:=nil;
          result:=nil;
          typecheckpass(left);
          typecheckpass(left);
-         set_varstate(left,vs_read,[]);
+         set_varstate(left,vs_read,[vsf_must_be_valid]);
          if codegenerror then
          if codegenerror then
            exit;
            exit;
 
 

+ 8 - 0
tests/tbf/tb0195.pp

@@ -0,0 +1,8 @@
+{ %fail }
+{ %opt=-Sew }
+
+var
+  a: longint;
+begin
+  a := not a;
+end.