浏览代码

* Fixed bug #17413 (and the tw17413 test) for aarch64 by adding additional check.

git-svn-id: trunk@39951 -
yury 6 年之前
父节点
当前提交
7c94d00a4a
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      compiler/ncgld.pas

+ 3 - 1
compiler/ncgld.pas

@@ -112,7 +112,9 @@ implementation
                  { ... at the place we are looking for }
                  { ... at the place we are looking for }
                  references_equal(tabstractnormalvarsym(tloadnode(n).symtableentry).localloc.reference,rr^.old^) and
                  references_equal(tabstractnormalvarsym(tloadnode(n).symtableentry).localloc.reference,rr^.old^) and
                  { its address cannot have escaped the current routine }
                  { its address cannot have escaped the current routine }
-                 not(tabstractvarsym(tloadnode(n).symtableentry).addr_taken) then
+                 not(tabstractvarsym(tloadnode(n).symtableentry).addr_taken) and
+                 { it is not accessed in nested procedures }
+                 not(tabstractvarsym(tloadnode(n).symtableentry).different_scope) then
                 begin
                 begin
                   { relocate variable }
                   { relocate variable }
                   tcgloadnode(n).changereflocation(rr^.new^);
                   tcgloadnode(n).changereflocation(rr^.new^);