Zebediah Figura : msvcrt: Avoid using inline assembly in call_finally_block().

Alexandre Julliard julliard at winehq.org
Mon Jun 11 13:10:51 CDT 2018


Module: wine
Branch: master
Commit: f96a3b735bd2dacf323d132413b93765013bed1f
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=f96a3b735bd2dacf323d132413b93765013bed1f

Author: Zebediah Figura <zfigura at codeweavers.com>
Date:   Mon Jun  4 17:23:33 2018 -0500

msvcrt: Avoid using inline assembly in call_finally_block().

Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/msvcrt/except_i386.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/dlls/msvcrt/except_i386.c b/dlls/msvcrt/except_i386.c
index 2c845b2..508e2ee 100644
--- a/dlls/msvcrt/except_i386.c
+++ b/dlls/msvcrt/except_i386.c
@@ -181,11 +181,11 @@ __ASM_GLOBAL_FUNC( continue_after_catch,
                    "leal 12(%edx), %ebp\n\t"
                    "jmp *%eax" );
 
-static inline void call_finally_block( void *code_block, void *base_ptr )
-{
-    __asm__ __volatile__ ("movl %1,%%ebp; call *%%eax"
-                          : : "a" (code_block), "g" (base_ptr));
-}
+extern void DECLSPEC_NORETURN call_finally_block( void *code_block, void *base_ptr );
+
+__ASM_GLOBAL_FUNC( call_finally_block,
+                   "movl 8(%esp), %ebp\n\t"
+                   "jmp *4(%esp)" );
 
 static inline int call_filter( int (*func)(PEXCEPTION_POINTERS), void *arg, void *ebp )
 {
@@ -938,7 +938,6 @@ int CDECL _except_handler3(PEXCEPTION_RECORD rec,
           frame->trylevel = pScopeTable[trylevel].previousTryLevel;
           TRACE("__finally block %p\n",pScopeTable[trylevel].lpfnHandler);
           call_finally_block(pScopeTable[trylevel].lpfnHandler, &frame->_ebp);
-          ERR("Returned from __finally block - expect crash!\n");
        }
       }
       trylevel = pScopeTable[trylevel].previousTryLevel;
@@ -1012,7 +1011,6 @@ int CDECL _except_handler4_common( ULONG *cookie, void (*check_cookie)(void),
                     frame->trylevel = scope_table->entries[trylevel].previousTryLevel;
                     TRACE("__finally block %p\n",scope_table->entries[trylevel].lpfnHandler);
                     call_finally_block(scope_table->entries[trylevel].lpfnHandler, &frame->_ebp);
-                    ERR("Returned from __finally block - expect crash!\n");
                 }
             }
             trylevel = scope_table->entries[trylevel].previousTryLevel;




More information about the wine-cvs mailing list