Ver código fonte

* also perform initialised checking for out-parameter, and set the
initialised state of value/const/var parameters to initialised

git-svn-id: trunk@2487 -

Jonas Maebe 19 anos atrás
pai
commit
7edc9d0e6a
2 arquivos alterados com 3 adições e 2 exclusões
  1. 1 2
      compiler/htypechk.pas
  2. 2 0
      compiler/symsym.pas

+ 1 - 2
compiler/htypechk.pas

@@ -804,8 +804,7 @@ implementation
                            not(vo_is_external in hsym.varoptions) and
                            (hsym.owner.symtabletype in [parasymtable,localsymtable,staticsymtable]) and
                            ((hsym.owner=current_procinfo.procdef.localst) or
-                            ((hsym.owner=current_procinfo.procdef.parast) and
-                             (vo_is_funcret in hsym.varoptions))) then
+                            (hsym.owner=current_procinfo.procdef.parast)) then
                           begin
                             if (vo_is_funcret in hsym.varoptions) then
                               begin

+ 2 - 0
compiler/symsym.pas

@@ -1545,6 +1545,8 @@ implementation
     constructor tparavarsym.create(const n : string;nr:word;vsp:tvarspez;const tt : ttype;vopts:tvaroptions);
       begin
          inherited create(paravarsym,n,vsp,tt,vopts);
+         if (vsp in [vs_var,vs_value,vs_const]) then
+           varstate := vs_initialised;
          paranr:=nr;
          paraloc[calleeside].init;
          paraloc[callerside].init;