浏览代码

* in case of finally nodes of implicit frames with a third=nil, exit has to load 0 into the exception value, so an explicit exit call is not handled as an exception

git-svn-id: branches/debug_eh@41318 -
florian 6 年之前
父节点
当前提交
a3594574ca
共有 1 个文件被更改,包括 4 次插入6 次删除
  1. 4 6
      compiler/ncgflw.pas

+ 4 - 6
compiler/ncgflw.pas

@@ -87,7 +87,7 @@ interface
            envbuf,
            reasonbuf  : treference;
            { when using dwarf based eh handling, the landing pads get the unwind info passed, it is
-             stored in the given register so it can be passed to unwind_resum }
+             stored in the given register so it can be passed to unwind_resume }
            unwind_info : TRegister;
          end;
 
@@ -1427,11 +1427,7 @@ implementation
 
     function tcgtryfinallynode.get_jump_out_of_try_finally_frame_label(const finallyexceptionstate: tcgexceptionstatehandler.texceptionstate): tasmlabel;
       begin
-         if implicitframe and
-            not assigned(third) then
-           result:=finallyexceptionstate.exceptionlabel
-         else
-           current_asmdata.getjumplabel(result);
+        current_asmdata.getjumplabel(result);
       end;
 
 
@@ -1615,6 +1611,8 @@ implementation
                    handle_safecall_exception
                  else
                    cexceptionstatehandler.handle_reraise(current_asmdata.CurrAsmList,excepttemps,finallyexceptionstate,exceptframekind);
+                 { we have to load 0 into the execepttemp, else the program thinks an exception happended }
+                 emit_jump_out_of_try_finally_frame(current_asmdata.CurrAsmList,0,finallyexceptionstate.exceptionlabel,excepttemps,exitfinallylabel);
                end
              else
                begin