mirror of
git://git.musl-libc.org/musl
synced 2024-12-12 18:01:27 +00:00
riscv64: fix fesetenv(FE_DFL_ENV) crash
When FE_DFL_ENV is passed to fesetenv(), the very first instruction lw t1, 0(a0) will fail since a0 is -1.
This commit is contained in:
parent
daa29e894c
commit
c0b4a7b254
@ -45,8 +45,11 @@ fegetenv:
|
||||
.global fesetenv
|
||||
.type fesetenv, %function
|
||||
fesetenv:
|
||||
li t2, -1
|
||||
li t1, 0
|
||||
beq a0, t2, 1f
|
||||
lw t1, 0(a0)
|
||||
fscsr t0, t1
|
||||
1: fscsr t1
|
||||
li a0, 0
|
||||
ret
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user