Repository navigation
feat(libc): implement index string search - #8842
Merged
Merged
Conversation
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds the legacy
index(const char*, int)string search to the common libc exports, beside the existingstrchrandrindex. It returns the first matching byte, including the terminating NUL, by forwarding to the existingstrchrimplementation. There is no allocation or new mutable state.Name and NID
t3RFHn0bTPgappear in the public PS5 3.20 libSceLibcInternal inventory. The public PS5 payload SDK declaration supplies the prototype. FreeBSD 11.4 strchr.c makesindexa weak alias ofstrchr. These establish the public interface and reference behavior; this was not measured on a PS5, and the inventory does not establish module/library versions. Null string pointers are outside the reference function's defined input domain.Tested
Windows x86-64, supported WinLibs MinGW-w64 GCC 15.2.0, Release full configuration with
BUILD_TESTING=ONin an independent checkout ofcd700fe9ec.^(guest_index|guest_allocating_strings|guest_strings|guest_wide_strings)$.guest_indexfails withindex is missing from libc. Candidate: all four pass, no skips. The new test covers first matches, absence, empty strings, NUL, high bytes, integer conversion from -512 through 512 and INT_MIN/INT_MAX, unchanged input, returned original writable storage, and 257 string lengths ending immediately before a protected page.t3RFHn0bTPgin its PE export table.libstarget and ranctest -R '^patched_libraries$' -V: all 354 patched libraries loaded, zero failed. This is structural/load validation. Configuration initially inherited an empty processor name from the tool environment; a fresh configure with the verifiedPROCESSOR_ARCHITECTURE=AMD64restored selected mimalloc's correct x64 redirect dependency, with no source changes.tools/pr_overlap.py --branch feat/libc-index --repo boykopovar/AnyPS5completed after fetching missing partial-clone objects. It reported no confirmed same-export or merge collisions, but could not compare shared files for 12 PRs already conflicting with main (fix(windows): enter guest startup on an arena-backed main stack #3965, feat(aot): consolidate native ARM64 compiler, runtime and consumers #5021, test: organize library tests and label CTest suites #6044, feat(libc): answer every libunwind cursor slot of an unwind context #6819, feat(wasm): run relinked titles in the browser with WebGPU #6879, fix(libs): share Sony CRT handler and lconv state between libc and libSceAmpr #7081, Macos port #7201, fix(libc): provide ASOBI_ROOT environment variable for title path resolution #7715, fix(libc): support character reads from random device streams #8150, feat(libc): export _Thrd_yield #8352, feat(libkernel): enumerate archived app directories #8520, fix(libc): match shipped CRT ABI and constraint behavior #8711). Manually inspected their shared-file diffs: none addsindex, changes the strchr/rindex region, or adds this test. test: organize library tests and label CTest suites #6044 reorganizes test paths and registration, so that broad reorganization would require integrating this new test if it lands later.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)