public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
From: Corinna Vinschen <corinna@sourceware.org>
To: newlib-cvs@sourceware.org
Subject: [newlib-cygwin] or1k: Correct longjmp return value
Date: Thu, 27 Jun 2019 07:09:00 -0000	[thread overview]
Message-ID: <20190627070954.55741.qmail@sourceware.org> (raw)

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


                 reply	other threads:[~2019-06-27  7:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190627070954.55741.qmail@sourceware.org \
    --to=corinna@sourceware.org \
    --cc=newlib-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).