Browse Source

* fixed type correctness of array parameter handling for calls to
fpc_addref_array/fpc_finalize_array (those helpers expect a pointer
to the elements of the array, not a pointer to the array)

git-svn-id: trunk@32779 -

Jonas Maebe 9 years ago
parent
commit
1a09209659
1 changed files with 2 additions and 0 deletions
  1. 2 0
      compiler/hlcgobj.pas

+ 2 - 0
compiler/hlcgobj.pas

@@ -4878,6 +4878,7 @@ implementation
                 else
                   highloc.loc:=LOC_INVALID;
                 eldef:=tarraydef(tparavarsym(p).vardef).elementdef;
+                g_ptrtypecast_ref(list,cpointerdef.getreusable(tparavarsym(p).vardef),cpointerdef.getreusable(eldef),href);
                 g_array_rtti_helper(list,eldef,href,highloc,'fpc_finalize_array');
               end
             else
@@ -4943,6 +4944,7 @@ implementation
                          { open arrays do not contain correct element count in their rtti,
                            the actual count must be passed separately. }
                          eldef:=tarraydef(tparavarsym(p).vardef).elementdef;
+                         g_ptrtypecast_ref(list,cpointerdef.getreusable(tparavarsym(p).vardef),cpointerdef.getreusable(eldef),href);
                          g_array_rtti_helper(list,eldef,href,highloc,'fpc_addref_array');
                        end
                      else