public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] or1k: Correct longjmp return value
@ 2019-06-27  7:09 Corinna Vinschen
  0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2019-06-27  7:09 UTC (permalink / raw)
  To: newlib-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=8b080534cadd8b9e920c8b023e341937a2e274bc

commit 8b080534cadd8b9e920c8b023e341937a2e274bc
Author: Martin Erik Werner <martinerikwerner.aac@gmail.com>
Date:   Wed Jun 26 17:44:54 2019 +0200

    or1k: Correct longjmp return value
    
    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.

Diff:
---
 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 5c02327..0b93a03 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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-06-27  7:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-27  7:09 [newlib-cygwin] or1k: Correct longjmp return value Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).