Re: [PATCH] or1k: Correct longjmp return value

Corinna Vinschen <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
On Jun 26 17:44, Martin Erik Werner wrote:
> Invert equality check instruction to correct the return value handling
> in longjmp.
> 
> The return value should be the value of the second argument to longjmp,
> unless the argument value was 0 in which case it should be 1.
> 
> Previously, longjmp would set return value 1 if the second argument was
> non-zero, and 0 if it was 0, which was incorrect.
> ---
>  newlib/libc/machine/or1k/setjmp.S | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/newlib/libc/machine/or1k/setjmp.S b/newlib/libc/machine/or1k/setjmp.S
> index 5c023278d..0b93a0342 100644
> --- a/newlib/libc/machine/or1k/setjmp.S
> +++ b/newlib/libc/machine/or1k/setjmp.S
> @@ -70,7 +70,7 @@ longjmp:
>    /* If the second argument to longjmp is zero, set return address to 1,
>    otherwise set it to the value of the second argument */
>  	l.addi	r11, r0, 1
> -	l.sfne	r4, r0
> +	l.sfeq	r4, r0
>  	l.bf	1f
>  	l.nop
>  	l.addi	r11, r4, 0
> -- 
> 2.11.0

Pushed.

Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEoVYPmneWZnwT6kwF9TYGna5ET6AFAl0Ua9oACgkQ9TYGna5E
T6DMyg//YhgQ0HAUyET53n+MnRhwrRJzqHtmdI+npsESmLAReMn2i8AuHG0o6mLK
8Vl+kNTNMMS6052k281Eaa9ygqUcW8FIm26NOdAxXbPTQMrIhphy8NBujrN7Y+eX
wOIXxzM6zuZkbMsvv6cr8KiUTIvkNtaQWM860FJ4OreOPcVYZVIPr5bX11x8Mhp5
XRnAT6tzz8gXPNxSBdSPT/+eh2vsfG5B1fA5o8jxjTGABqlLA7fRnsiQNAFKpTwf
lbZSzxf5qCcebgZIJf702iOk49/dC4mfbiVVx3n68ZpodfqgqBo6VkAhk1YAAKqh
6FCm0ZAiZeFA4vaDc95pWXx7MVMJb3tthxZMNB83Pf/oKQUqINfOWx2sv0671TSp
XqqcG2wX/Ao8E/on6tfd1+tZzVXrQiQbCEHwlBe7ZFfDL6djS5Dkvs6ZMGAaY77O
MXfuqL/6MvTOAk/V55Cj1GSNy7AX0mHyjWrGLvsh9FSNdAhzX4aS+T/HfFuuLZ2Q
l2sYxcsp3QQWWtEgoWyqziS4BJrQkGb5uHXAzu3PHz9zAMGF2OuKfMz2YPh1i6K7
Npr0iyCvgYixL2/l4bj3Rh3mDm/e+Y2uyuU78AJXK+3m6F+frlAOJmUNZVMC8OtD
mUH8jg38vIXcLMyG9fPYHM8w1fP+BTlNwWk1dFreaG9xEyULiuU=
=EUo6
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.