[PATCH 0/2] riscv: Fix RVV strrchr character conversion
Chengrong Dai
daichengrong@iscas.ac.cn
Mon Nov 23 08:11:36 GMT 2026
From: daichengrong <daichengrong@iscas.ac.cn>
The RVV strrchr implementation checks the full int argument for zero
before converting it to a character. Nonzero arguments such as 256
and -256 therefore skip the zero-search path, and the ordinary path
excludes the terminating NUL, incorrectly returning NULL.
Truncate the argument to eight bits before the zero check and add
regression coverage for character argument conversion.
Co-authored-by: Yuansheng <yuansheng@isrc.iscas.ac.cn>
Signed-off-by: daichengrong <daichengrong@iscas.ac.cn>
daichengrong (2):
riscv: Fix character conversion in RVV strrchr
string: Test strrchr character argument conversion
string/test-strrchr.c | 38 ++++++++++++++++++++++++++++++++++++++
sysdeps/riscv/rvv/strrchr.S | 1 +
2 files changed, 39 insertions(+)
base-commit: 0fcc25beff5ba1aa127d31593c1e9b4329545945
More information about the Libc-alpha
mailing list