Bläddra i källkod

* in constructors, free the temp holding self only after loading the function
result, as self is the function result there (follow up to 40501)

git-svn-id: trunk@40635 -

Jonas Maebe 6 år sedan
förälder
incheckning
c9a7afe053
1 ändrade filer med 4 tillägg och 2 borttagningar
  1. 4 2
      compiler/ncgutil.pas

+ 4 - 2
compiler/ncgutil.pas

@@ -1818,9 +1818,11 @@ implementation
                         begin
                           { can't free the result, because we load it after
                             this call into the function result location
-                            (gets freed in thlcgobj.gen_load_return_value() }
+                            (gets freed in thlcgobj.gen_load_return_value();) }
                           if (typ in [localvarsym,paravarsym]) and
-                             (([vo_is_funcret,vo_is_result]*varoptions)=[]) then
+                             (([vo_is_funcret,vo_is_result]*varoptions)=[]) and
+                             ((current_procinfo.procdef.proctypeoption<>potype_constructor) or
+                              not(vo_is_self in varoptions)) then
                             tg.Ungetlocal(list,localloc.reference);
                         end;
                     end;