Преглед на файлове

* Fixed expectloc of local variables passed as a formal parameter. This issue is caught by cycling the compiler with -dEXTDEBUG. Yet the compiler can't cycle with EXTDEBUG due to other issues with wrong expectloc.

git-svn-id: trunk@48650 -
yury преди 4 години
родител
ревизия
4245b20a32
променени са 1 файла, в които са добавени 10 реда и са изтрити 0 реда
  1. 10 0
      compiler/ncal.pas

+ 10 - 0
compiler/ncal.pas

@@ -1392,6 +1392,16 @@ implementation
                         else
                           make_not_regable(left,[ra_addr_regable])
                       end;
+                    vs_const:
+                      if parasym.vardef.typ=formaldef then
+                        begin
+                          { compilerprocs never capture the address of their
+                            parameters }
+                          if not(po_compilerproc in aktcallnode.procdefinition.procoptions) then
+                            make_not_regable(left,[ra_addr_regable,ra_addr_taken])
+                          else
+                            make_not_regable(left,[ra_addr_regable])
+                        end;
                     else
                       set_varstate(left,vs_read,[vsf_must_be_valid]);
                   end;