diff options
author | Martin Erik Werner <martinerikwerner.aac@gmail.com> | 2019-06-26 17:44:54 +0200 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2019-06-27 09:09:37 +0200 |
commit | 8b080534cadd8b9e920c8b023e341937a2e274bc (patch) | |
tree | 1c3098f7badb8a6baa765e396e9aa801e313a370 | |
parent | 09e2ec87efa5ba167dffd19d39ce7a59b7ef7877 (diff) | |
download | cygnal-8b080534cadd8b9e920c8b023e341937a2e274bc.tar.gz cygnal-8b080534cadd8b9e920c8b023e341937a2e274bc.tar.bz2 cygnal-8b080534cadd8b9e920c8b023e341937a2e274bc.zip |
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.
-rw-r--r-- | newlib/libc/machine/or1k/setjmp.S | 2 |
1 files changed, 1 insertions, 1 deletions
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 |