Sfoglia il codice sorgente

* fixed warnings about "uninitialized" initialized local variables
based on test for web bug #7285 (which was already fixed)

git-svn-id: trunk@5523 -

Jonas Maebe 18 anni fa
parent
commit
7588b4378c
3 ha cambiato i file con 22 aggiunte e 0 eliminazioni
  1. 1 0
      .gitattributes
  2. 1 0
      compiler/pdecvar.pas
  3. 20 0
      tests/webtbs/tw7285.pp

+ 1 - 0
.gitattributes

@@ -7731,6 +7731,7 @@ tests/webtbs/tw7195.pp svneol=native#text/plain
 tests/webtbs/tw7227.pp svneol=native#text/plain
 tests/webtbs/tw7276.pp svneol=native#text/plain
 tests/webtbs/tw7281.pp svneol=native#text/plain
+tests/webtbs/tw7285.pp svneol=native#text/plain
 tests/webtbs/tw7329.pp svneol=native#text/plain
 tests/webtbs/tw7372.pp svneol=native#text/plain
 tests/webtbs/tw7379.pp svneol=native#text/plain

+ 1 - 0
compiler/pdecvar.pas

@@ -698,6 +698,7 @@ implementation
             else
               internalerror(200611051);
           end;
+          vs.varstate:=vs_initialised;
         end;
 
         procedure read_gpc_name(sc : TFPObjectList);

+ 20 - 0
tests/webtbs/tw7285.pp

@@ -0,0 +1,20 @@
+{ %opt=-Sehw }
+
+type myclass=class(TObject)
+      procedure myproc(); 
+     end; 
+
+procedure myclass.myproc(); 
+var avalue:integer=100; 
+begin
+     writeln(avalue); 
+end; 
+
+
+var
+  c: myclass;
+begin
+  c := myclass.create;
+  c.myproc;
+  c.free;
+end.