Browse Source

* pass this to C++ methods always by reference

git-svn-id: trunk@7154 -
florian 18 years ago
parent
commit
00076c1076
1 changed files with 3 additions and 0 deletions
  1. 3 0
      compiler/ncgcal.pas

+ 3 - 0
compiler/ncgcal.pas

@@ -408,6 +408,9 @@ implementation
                  { don't push a node that already generated a pointer type
                    by address for implicit hidden parameters }
                  if (vo_is_funcret in parasym.varoptions) or
+                   { pass "this" in C++ classes explicitly as pointer
+                     because push_addr_param might not be true for them }
+                   (is_cppclass(parasym.vardef) and (vo_is_self in parasym.varoptions)) or
                     (not(left.resultdef.typ in [pointerdef,classrefdef]) and
                      paramanager.push_addr_param(parasym.varspez,parasym.vardef,
                          aktcallnode.procdefinition.proccalloption)) then