Browse Source

* It is needed to destroy exception object in safecall procedure as well.

git-svn-id: trunk@7722 -
yury 18 years ago
parent
commit
9844174e5e
1 changed files with 2 additions and 1 deletions
  1. 2 1
      compiler/ncgflw.pas

+ 2 - 1
compiler/ncgflw.pas

@@ -1480,8 +1480,9 @@ implementation
 {$if defined(x86) or defined(arm)}
 {$if defined(x86) or defined(arm)}
              if current_procinfo.procdef.proccalloption=pocall_safecall then
              if current_procinfo.procdef.proccalloption=pocall_safecall then
                begin
                begin
-                 { Remove the last exception object }
+                 { Remove and destroy the last exception object }
                  cg.a_call_name(current_asmdata.CurrAsmList,'FPC_POPOBJECTSTACK');
                  cg.a_call_name(current_asmdata.CurrAsmList,'FPC_POPOBJECTSTACK');
+                 cg.a_call_name(current_asmdata.CurrAsmList,'FPC_DESTROYEXCEPTION');
                  { Set return value of safecall procedure to indicate exception.       }
                  { Set return value of safecall procedure to indicate exception.       }
                  { Exception will be raised after procedure exit based on return value }
                  { Exception will be raised after procedure exit based on return value }
                  cg.a_load_const_reg(current_asmdata.CurrAsmList,OS_ADDR,aint($8000FFFF),NR_FUNCTION_RETURN_REG);
                  cg.a_load_const_reg(current_asmdata.CurrAsmList,OS_ADDR,aint($8000FFFF),NR_FUNCTION_RETURN_REG);