提交 c0b4a7b2 编写于 作者: R Ruinland ChuanTzu Tsai 提交者: Rich Felker

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.
上级 daa29e89
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册