Piotr Caban : msvcrt: Don' t call local_unwind2 when Cookie equals MSVCRT_JMP_MAGIC in longjmp.

Alexandre Julliard julliard at winehq.org
Thu Dec 20 12:39:56 CST 2012


Module: wine
Branch: master
Commit: 76969a8651f525cb87095a80ba4c220888ef6226
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=76969a8651f525cb87095a80ba4c220888ef6226

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Thu Dec 20 11:13:45 2012 +0100

msvcrt: Don't call local_unwind2 when Cookie equals MSVCRT_JMP_MAGIC in longjmp.

---

 dlls/msvcrt/except_i386.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/dlls/msvcrt/except_i386.c b/dlls/msvcrt/except_i386.c
index 7c3265c..8639579 100644
--- a/dlls/msvcrt/except_i386.c
+++ b/dlls/msvcrt/except_i386.c
@@ -1014,17 +1014,18 @@ void CDECL MSVCRT_longjmp(struct MSVCRT___JUMP_BUFFER *jmp, int retval)
 
     if (jmp->Registration)
     {
-        if (!IsBadReadPtr(&jmp->Cookie, sizeof(long)) &&
-            jmp->Cookie == MSVCRT_JMP_MAGIC && jmp->UnwindFunc)
+        if (IsBadReadPtr(&jmp->Cookie, sizeof(long)) || jmp->Cookie != MSVCRT_JMP_MAGIC)
+        {
+            msvcrt_local_unwind2((MSVCRT_EXCEPTION_FRAME*)jmp->Registration,
+                                 jmp->TryLevel, (void *)jmp->Ebp);
+        }
+        else if(jmp->UnwindFunc)
         {
             MSVCRT_unwind_function unwind_func;
 
             unwind_func=(MSVCRT_unwind_function)jmp->UnwindFunc;
             unwind_func(jmp);
         }
-        else
-            msvcrt_local_unwind2((MSVCRT_EXCEPTION_FRAME*)jmp->Registration,
-                                 jmp->TryLevel, (void *)jmp->Ebp);
     }
 
     if (!retval)




More information about the wine-cvs mailing list