在 2026-11-9 21:54, LIU Hao 写道:
在 2026-11-5 06:47, Pali Rohár 写道:Hello, when you have a time, could you look at my changes in the mingw_setjmp_v3.patches file sent in the previous email?Just for information all those commits were applied on the top of the master branch at time of sending them, which was on top of the commit 088d2039f9f5ca872092c7a03c765936a93011f8 I understand that it is quite a larger change and probably needs more time for looking it at. Commits are prepared in a way that they can be applied also one-by-one with respect to tests. So it is possible to take and look at just first few of them.I tried looking into these patches for some times, but these are, nonetheless, a very complicated series of changes. So far I consider to take these piece by piece. The first two seem quite obvious. I can push them tomorrow.
Patch 0009 has pushl 4(%esp) cmpl $2,8(%esp) setge %dl movzbl %dl,%edx neg %edx calll __MINGW_LSYMBOL(setjmp_common) popl %ecx /* jmp_buf */The first instruction pushes `jmp_buf`, so `esp+8` no longer points to the argument `count`; it now points to `jmp_buf`. This is fixed by
diff --git a/mingw-w64-crt/misc/setjmp.S b/mingw-w64-crt/misc/setjmp.S
index 5fa967722..627bc65c9 100644
--- a/mingw-w64-crt/misc/setjmp.S
+++ b/mingw-w64-crt/misc/setjmp.S
@@ -61,14 +61,14 @@ __MINGW_USYMBOL(__MINGW_IMP_SYMBOL(_setjmp)):
#if defined(__i386__)
__MINGW_USYMBOL(_setjmp3):
- pushl 4(%esp)
/* edx == -1 -> setjmp_common will NOT inspect SEH try_level */
/* edx != -1 -> setjmp_common will inspect SEH try_level */
/* Do not inspect SEH try_level when _Count >= 2 -> means that try_level is provided as
_TryLevel param */
- cmpl $2,8(%esp)
+ cmpl $2,8(%esp) /* _Count */
setge %dl
movzbl %dl,%edx
neg %edx
+ pushl 4(%esp)
calll __MINGW_LSYMBOL(setjmp_common)
popl %ecx /* jmp_buf */
I have pushed these patches with the fix:
0008 crt: Fill all i386 jmp_buf members in mingw-w64 _setjmp() function for
ucrtapp builds
0009 crt: Properly implement i386 mingw-w64 _setjmp3() function for ucrtapp
builds
0010 crt: Fix mingw-w64 amd64 setjmp/__intrinsic_setjmp/_setjmp and arm32 __intrinsic_setjmp/_setjmp
functions for ucrtapp builds
0011 crt: Define setjmp function aliases for arm64ec ucrtapp builds 0012 crt: Define imp symbols in setjmp.S for ucrtapp builds I'll look into patches 3-7. -- Best regards, LIU Hao
OpenPGP_signature.asc
Description: OpenPGP digital signature
_______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
