浏览代码

* Force OPR_LOCAL operand into reference whenever subscripting is used, so that all record fields are handled in same way regardless of their offset. Previously, operand was changed to reference only by fields with non-zero offset (see logic in tcgasmnode.ResolveRef method).

git-svn-id: trunk@34911 -
sergei 9 年之前
父节点
当前提交
d5ffc2da97
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      compiler/x86/rax86int.pas

+ 2 - 1
compiler/x86/rax86int.pas

@@ -1724,8 +1724,9 @@ Unit Rax86int;
                            (oper.opr.localsym.owner.symtabletype=parasymtable) and
                            (oper.opr.localsym.owner.symtabletype=parasymtable) and
                            (current_procinfo.procdef.proccalloption<>pocall_register) then
                            (current_procinfo.procdef.proccalloption<>pocall_register) then
                           Message(asmr_e_cannot_access_field_directly_for_parameters);
                           Message(asmr_e_cannot_access_field_directly_for_parameters);
-                        inc(oper.opr.localsymofs,toffset);
 
 
+                        oper.opr.localforceref:=true;
+                        inc(oper.opr.localsymofs,toffset);
                         oper.opr.localvarsize := tsize;
                         oper.opr.localvarsize := tsize;
                       end;
                       end;
                     OPR_CONSTANT :
                     OPR_CONSTANT :