projects
/
oweals
/
musl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
daa29e8
)
riscv64: fix fesetenv(FE_DFL_ENV) crash
author
Ruinland ChuanTzu Tsai
<ruinland@andestech.com>
Mon, 2 Dec 2019 11:06:52 +0000
(19:06 +0800)
committer
Rich Felker
<dalias@aerifal.cx>
Sat, 7 Dec 2019 17:58:39 +0000
(12:58 -0500)
When FE_DFL_ENV is passed to fesetenv(), the very first instruction
lw t1, 0(a0) will fail since a0 is -1.
src/fenv/riscv64/fenv.S
patch
|
blob
|
history
diff --git
a/src/fenv/riscv64/fenv.S
b/src/fenv/riscv64/fenv.S
index f149003d2eeade71c05fd188d913d2256f918f43..0ea78bf9ac8da26706215e4696a5d865c830e2c1 100644
(file)
--- a/
src/fenv/riscv64/fenv.S
+++ b/
src/fenv/riscv64/fenv.S
@@
-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