Browse Source

--- Merging r22380 into '.':
A tests/webtbs/tw22869.pp
U compiler/ncgutil.pas

# revisions: 22380
r22380 | jonas | 2012-09-13 14:35:31 +0200 (Thu, 13 Sep 2012) | 2 lines
Changed paths:
M /trunk/compiler/ncgutil.pas
A /trunk/tests/webtbs/tw22869.pp

* support LOC_(C)SUBSETREG/REF in gen_load_vmt_register() (mantis #22869)

git-svn-id: branches/fixes_2_6@22436 -

marco 13 năm trước cách đây
mục cha
commit
c9ff792522
3 tập tin đã thay đổi với 35 bổ sung1 xóa
  1. 1 0
      .gitattributes
  2. 5 1
      compiler/ncgutil.pas
  3. 29 0
      tests/webtbs/tw22869.pp

+ 1 - 0
.gitattributes

@@ -11950,6 +11950,7 @@ tests/webtbs/tw2269.pp svneol=native#text/plain
 tests/webtbs/tw2274.pp svneol=native#text/plain
 tests/webtbs/tw2277.pp svneol=native#text/plain
 tests/webtbs/tw2280.pp svneol=native#text/plain
+tests/webtbs/tw22869.pp svneol=native#text/plain
 tests/webtbs/tw2289.pp svneol=native#text/plain
 tests/webtbs/tw2291.pp svneol=native#text/plain
 tests/webtbs/tw2294.pp svneol=native#text/plain

+ 5 - 1
compiler/ncgutil.pas

@@ -3088,7 +3088,11 @@ implementation
                 end;
               LOC_CREGISTER,
               LOC_CREFERENCE,
-              LOC_REFERENCE:
+              LOC_REFERENCE,
+              LOC_CSUBSETREG,
+              LOC_SUBSETREG,
+              LOC_CSUBSETREF,
+              LOC_SUBSETREF:
                 begin
                   reference_reset_base(href,cg.getaddressregister(list),objdef.vmt_offset,sizeof(pint));
                   cg.a_load_loc_reg(list,OS_ADDR,selfloc,href.base);

+ 29 - 0
tests/webtbs/tw22869.pp

@@ -0,0 +1,29 @@
+{$mode objfpc}
+
+type
+  tc = class
+    procedure test; virtual;
+  end;
+
+  trec = record
+    c: tc;
+  end;
+
+procedure tc.test;
+begin
+end;
+
+procedure doit(r: trec);
+begin
+  r.c.test;
+end;
+
+var
+  r: trec;
+  c: tc;
+begin
+  c:=tc.create;
+  r.c:=c;
+  doit(r);
+  c.free;
+end.