ソースを参照

* change the exception address is only useful if a valid frame is passed

git-svn-id: branches/debug_eh@41377 -
florian 6 年 前
コミット
9e67e7311a
1 ファイル変更9 行追加3 行削除
  1. 9 3
      rtl/inc/psabieh.inc

+ 9 - 3
rtl/inc/psabieh.inc

@@ -981,9 +981,15 @@ procedure fpc_RaiseException_Internal(Obj: TObject; AnAddr: CodePointer; AFrame:
 { tweak stack, so we get the correct context, this requires assembly }
 procedure fpc_RaiseException(Obj: TObject; AnAddr: CodePointer; AFrame: Pointer); compilerproc;assembler; nostackframe;
 asm
-   movl AFrame,%ebp
-   movl AnAddr,(%esp)
-   jmpl fpc_RaiseException_Internal
+  { loading the address makes only sense if a frame is passed, else unwinding is completly mixed up }
+  orl AFrame,AFrame
+  je .L1
+  movl AFrame,%ebp
+  orl AnAddr,AnAddr
+  je .L1
+  movl AnAddr,(%esp)
+.L1:
+  jmpl fpc_RaiseException_Internal
 end;
 {$define PSABI_HANDLESCONTEXT}
 {$endif CPUI386}