Browse Source

* fixed tprocvardef.size() for
a) C-blocks: they are equivalent to a voidpointertype, as they are
implicit pointer types
b) procvardefs created from static class methods (there is no
self pointer in this case)
o fixes webtbs/tw30936.pp with LLVM

git-svn-id: trunk@34977 -

Jonas Maebe 8 years ago
parent
commit
477283031c
1 changed files with 7 additions and 3 deletions
  1. 7 3
      compiler/symdef.pas

+ 7 - 3
compiler/symdef.pas

@@ -6386,9 +6386,13 @@ implementation
 
     function tprocvardef.size : asizeint;
       begin
-         if ((po_methodpointer in procoptions) or
-             is_nested_pd(self)) and
-            not(po_addressonly in procoptions) then
+         { we return false for is_addressonly for a block (because it's not a
+           simple pointer to a function), but they are handled as implicit
+           pointers to a datastructure that contains everything ->
+           voidpointertype.size instead of voidcodepointertype.size }
+         if po_is_block in procoptions then
+           size:=voidpointertype.size
+         else if not is_addressonly then
            begin
              if is_nested_pd(self) then
                size:=voidcodepointertype.size+parentfpvoidpointertype.size