From 7f24462fcb8db9559a7d2685ad975ba8414c371f Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Tue, 16 Jan 2007 16:34:44 +0000 Subject: [PATCH] * warn when doing not(uninitialised_variable) git-svn-id: trunk@6000 - --- .gitattributes | 1 + compiler/nmat.pas | 2 +- tests/tbf/tb0195.pp | 8 ++++++++ 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 tests/tbf/tb0195.pp diff --git a/.gitattributes b/.gitattributes index 27cf74ee5a..dcad83cf01 100644 --- a/.gitattributes +++ b/.gitattributes @@ -5664,6 +5664,7 @@ tests/tbf/tb0191.pp svneol=native#text/plain tests/tbf/tb0192.pp svneol=native#text/plain tests/tbf/tb0193.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/ub0149.pp svneol=native#text/plain tests/tbf/ub0158a.pp svneol=native#text/plain diff --git a/compiler/nmat.pas b/compiler/nmat.pas index 12a7052760..7eab24f821 100644 --- a/compiler/nmat.pas +++ b/compiler/nmat.pas @@ -859,7 +859,7 @@ implementation begin result:=nil; typecheckpass(left); - set_varstate(left,vs_read,[]); + set_varstate(left,vs_read,[vsf_must_be_valid]); if codegenerror then exit; diff --git a/tests/tbf/tb0195.pp b/tests/tbf/tb0195.pp new file mode 100644 index 0000000000..63a49c109d --- /dev/null +++ b/tests/tbf/tb0195.pp @@ -0,0 +1,8 @@ +{ %fail } +{ %opt=-Sew } + +var + a: longint; +begin + a := not a; +end.