Browse Source

* fixed web bug #4039 (include methodpointer init/fini for inlined methods)

git-svn-id: trunk@390 -
Jonas Maebe 20 years ago
parent
commit
893f45c9e2
1 changed files with 7 additions and 0 deletions
  1. 7 0
      compiler/ncal.pas

+ 7 - 0
compiler/ncal.pas

@@ -2212,6 +2212,13 @@ type
         { create blocks for loading/deleting of local data }
         createblock:=internalstatements(createstatement);
         deleteblock:=internalstatements(deletestatement);
+
+        { add methodpointer init/fini code to init/done statements }
+        if assigned(methodpointerinit) then
+          addstatement(createstatement,methodpointerinit.getcopy);
+        if assigned(methodpointerdone) then
+          addstatement(deletestatement,methodpointerdone.getcopy);
+
         inlinelocals:=tlist.create;
         { get copy of the procedure body }
         body:=tprocdef(procdefinition).inlininginfo^.code.getcopy;