Browse Source

* allow LOC_CONSTANT to be used as vmt pointers in the cg, resolves #21914

git-svn-id: trunk@21349 -
florian 13 years ago
parent
commit
21573f50c5
3 changed files with 12 additions and 0 deletions
  1. 1 0
      .gitattributes
  2. 1 0
      compiler/ncgutil.pas
  3. 10 0
      tests/webtbs/tw21914.pp

+ 1 - 0
.gitattributes

@@ -12599,6 +12599,7 @@ tests/webtbs/tw2185.pp svneol=native#text/plain
 tests/webtbs/tw2186.pp svneol=native#text/plain
 tests/webtbs/tw2186.pp svneol=native#text/plain
 tests/webtbs/tw2187.pp svneol=native#text/plain
 tests/webtbs/tw2187.pp svneol=native#text/plain
 tests/webtbs/tw21878.pp svneol=native#text/plain
 tests/webtbs/tw21878.pp svneol=native#text/plain
+tests/webtbs/tw21914.pp svneol=native#text/pascal
 tests/webtbs/tw21941.pp svneol=native#text/pascal
 tests/webtbs/tw21941.pp svneol=native#text/pascal
 tests/webtbs/tw21951.pp svneol=native#text/plain
 tests/webtbs/tw21951.pp svneol=native#text/plain
 tests/webtbs/tw2196.pp svneol=native#text/plain
 tests/webtbs/tw2196.pp svneol=native#text/plain

+ 1 - 0
compiler/ncgutil.pas

@@ -2027,6 +2027,7 @@ implementation
 {$endif cpu_uses_separate_address_registers}
 {$endif cpu_uses_separate_address_registers}
                     reference_reset_base(href,selfloc.register,objdef.vmt_offset,sizeof(pint));
                     reference_reset_base(href,selfloc.register,objdef.vmt_offset,sizeof(pint));
                 end;
                 end;
+              LOC_CONSTANT,
               LOC_CREGISTER,
               LOC_CREGISTER,
               LOC_CREFERENCE,
               LOC_CREFERENCE,
               LOC_REFERENCE:
               LOC_REFERENCE:

+ 10 - 0
tests/webtbs/tw21914.pp

@@ -0,0 +1,10 @@
+{ %norun }
+{$mode objfpc}
+program project1;
+function treeElementAsString(node: TObject): string; inline;
+begin
+  result:=node.ClassName
+end;
+begin
+  writeln(treeElementAsString(TObject(2)));
+end.