Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/msvcrt/cpp.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/dlls/msvcrt/cpp.c b/dlls/msvcrt/cpp.c index 07cde75..3402d13 100644 --- a/dlls/msvcrt/cpp.c +++ b/dlls/msvcrt/cpp.c @@ -1718,10 +1718,12 @@ void __cdecl __ExceptionPtrCreate(exception_ptr *ep) }
#ifdef __i386__ -static inline void call_dtor(const cxx_exception_type *type, void *func, void *object) -{ - __asm__ __volatile__("call *%0" : : "m" (func), "c" (object) : "eax", "edx", "memory"); -} +extern void call_dtor(const cxx_exception_type *type, void *func, void *object); + +__ASM_GLOBAL_FUNC( call_dtor, + "movl 12(%esp),%ecx\n\t" + "call *8(%esp)\n\t" + "ret" ); #elif __x86_64__ static inline void call_dtor(const cxx_exception_type *type, unsigned int dtor, void *object) {
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/msvcrt/cpp.c | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-)
diff --git a/dlls/msvcrt/cpp.c b/dlls/msvcrt/cpp.c index 3402d13..ea5dffe 100644 --- a/dlls/msvcrt/cpp.c +++ b/dlls/msvcrt/cpp.c @@ -1820,17 +1820,25 @@ void __cdecl __ExceptionPtrRethrow(const exception_ptr *ep) #if _MSVCR_VER >= 100
#ifdef __i386__ -static inline void call_copy_ctor( void *func, void *this, void *src, int has_vbase ) -{ - TRACE( "calling copy ctor %p object %p src %p\n", func, this, src ); - if (has_vbase) - /* in that case copy ctor takes an extra bool indicating whether to copy the base class */ - __asm__ __volatile__("pushl $1; pushl %2; call *%0" - : : "m" (func), "c" (this), "m" (src) : "eax", "edx", "memory" ); - else - __asm__ __volatile__("pushl %2; call *%0" - : : "m" (func), "c" (this), "m" (src) : "eax", "edx", "memory" ); -} +extern void call_copy_ctor( void *func, void *this, void *src, int has_vbase ); + +__ASM_GLOBAL_FUNC( call_copy_ctor, + "pushl %ebp\n\t" + __ASM_CFI(".cfi_adjust_cfa_offset 4\n\t") + __ASM_CFI(".cfi_rel_offset %ebp,0\n\t") + "movl %esp, %ebp\n\t" + __ASM_CFI(".cfi_def_cfa_register %ebp\n\t") + "cmpl $0, 20(%ebp)\n\t" + "jz 1f\n\t" + "pushl $1\n\t" + "1:\n\t" + "movl 12(%ebp), %ecx\n\t" + "pushl 16(%ebp)\n\t" + "call *8(%ebp)\n\t" + "leave\n" + __ASM_CFI(".cfi_def_cfa %esp,4\n\t") + __ASM_CFI(".cfi_same_value %ebp\n\t") + "ret" ); #else static inline void call_copy_ctor( void *func, void *this, void *src, int has_vbase ) {
Hi Zebediah,
Could you please also change the implementation in except_i386.c (there's identical call_copy_ctor function there).
Thanks, Piotr
On 06/01/18 00:13, Zebediah Figura wrote:
Signed-off-by: Zebediah Figura zfigura@codeweavers.com
dlls/msvcrt/cpp.c | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-)
diff --git a/dlls/msvcrt/cpp.c b/dlls/msvcrt/cpp.c index 3402d13..ea5dffe 100644 --- a/dlls/msvcrt/cpp.c +++ b/dlls/msvcrt/cpp.c @@ -1820,17 +1820,25 @@ void __cdecl __ExceptionPtrRethrow(const exception_ptr *ep) #if _MSVCR_VER >= 100
#ifdef __i386__ -static inline void call_copy_ctor( void *func, void *this, void *src, int has_vbase ) -{
- TRACE( "calling copy ctor %p object %p src %p\n", func, this, src );
- if (has_vbase)
/* in that case copy ctor takes an extra bool indicating whether to copy the base class */
__asm__ __volatile__("pushl $1; pushl %2; call *%0"
: : "m" (func), "c" (this), "m" (src) : "eax", "edx", "memory" );
- else
__asm__ __volatile__("pushl %2; call *%0"
: : "m" (func), "c" (this), "m" (src) : "eax", "edx", "memory" );
-} +extern void call_copy_ctor( void *func, void *this, void *src, int has_vbase );
+__ASM_GLOBAL_FUNC( call_copy_ctor,
"pushl %ebp\n\t"
__ASM_CFI(".cfi_adjust_cfa_offset 4\n\t")
__ASM_CFI(".cfi_rel_offset %ebp,0\n\t")
"movl %esp, %ebp\n\t"
__ASM_CFI(".cfi_def_cfa_register %ebp\n\t")
"cmpl $0, 20(%ebp)\n\t"
"jz 1f\n\t"
"pushl $1\n\t"
"1:\n\t"
"movl 12(%ebp), %ecx\n\t"
"pushl 16(%ebp)\n\t"
"call *8(%ebp)\n\t"
"leave\n"
__ASM_CFI(".cfi_def_cfa %esp,4\n\t")
__ASM_CFI(".cfi_same_value %ebp\n\t")
#else static inline void call_copy_ctor( void *func, void *this, void *src, int has_vbase ) {"ret" );
On 06/01/2018 11:18 AM, Piotr Caban wrote:
Hi Zebediah,
Could you please also change the implementation in except_i386.c (there's identical call_copy_ctor function there).
Thanks, Piotr
Sure, I'll send patches to change those as well.