Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
APItest.xs: remove unneeded SvPV_force_nolen()
The two API test wrappers utf16_to_utf8_reversed() and utf8_to_utf16(_reversed() included a call to SvPV_force_nolen(), because the underlying functions in utf8.c which they were wrapping used to modify the src buffer. However since v5.35.2-236-g5fd26678bf, these functions no longer modify the buffer, so the force is superfluous. So this commit removes force. As a side-effect, this fixes a failure in cd t; ./TEST -deparse ../ext/XS-APItest/t/utf16_to_utf8.t because the test file has this line: $utf16_of_U10302 = utf8_to_utf16_reversed(chr 0x10302); which after a round trip through deparse becomes: $utf16_of_U10302 = utf8_to_utf16_reversed("\x{10302}"); and it so happens that at compile time, the chr() form gets constant- folded into a modifiable PADTMP string constant, which survives a call to SvPV_force(), while the latter form is a pure read-only constant SV which croaks with "Modification of a read-only value attempted"
- Loading branch information