From dd38f49cdcc3630c541d9f603eb9b5dbeccbbe56 Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Mon, 18 Aug 2025 11:18:55 +0200 Subject: x86_64: Use TESTB instead of TESTL in CHECK_INVALID_LONGJMP There is no need to use TESTL when checking the least-significant bit with a TEST instruction. Use TESTB, which is three bytes shorter: f6 44 24 f0 01 testb $0x1,-0x10(%rsp) vs: f7 44 24 f0 01 00 00 testl $0x1,-0x10(%rsp) 00 for the same effect. No functional changes intended. Signed-off-by: Uros Bizjak Cc: H.J.Lu Cc: Carlos O'Donell Reviewed-by: H.J. Lu --- sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sysdeps/unix') diff --git a/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S b/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S index b73a18b..3bcdd6a 100644 --- a/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S +++ b/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S @@ -44,7 +44,7 @@ longjmp_msg: /* Without working sigaltstack we cannot perform the test. */ \ testl %eax, %eax; \ jne .Lok2; \ - testl $1, (-sizeSS + oSS_FLAGS)(%rsp); \ + testb $1, (-sizeSS + oSS_FLAGS)(%rsp); \ jz .Lfail; \ mov (-sizeSS + oSS_SP)(%rsp), %RAX_LP; \ add (-sizeSS + oSS_SIZE)(%rsp), %RAX_LP; \ -- cgit v1.1