Commit Graph
3 Commits
Author SHA1 Message Date
simnJS 2b10aa4211 fix(libSceJsc): bound UTF-8 input and decoded length as WebKit does
The shared UTF-8 decoder behind JSStringCreateWithUTF8CString and
JSStringIsEqualToUTF8CString now applies StringImpl::create's bounds: more
than INT32_MAX bytes throws before decoding, and non-ASCII input decoding to
more than 2147483635 UTF-16 units throws after a successful conversion.
GuestJSStringValidLength mirrors isValidLength and is tested at both limits.
2026-10-28 15:51:00 +01:00
simnJS 50c8d4cd8f feat(libSceJsc): answer the JSString null and length cases as JavaScriptCore does
JSStringCreateWithUTF8CString and JSStringIsEqualToUTF8CString take a null
UTF-8 pointer as a null string, and JSStringCreateWithCharacters returns a
null string for null characters of any length, as WebKit's JSStringRef.cpp
and WTF's String constructors do. A length above WebKit's 2147483635-unit
limit and a null handle given to retain, release or the maximum-size query
throw std exceptions where JavaScriptCore crashes. The reference count is a
wrapping 32-bit counter and the maximum UTF-8 size is computed in 32 bits,
as in WTF.
2026-10-28 14:55:42 +01:00
AZLisme 5746326efc feat(libSceJsc): implement JavaScriptCore string API 2026-10-25 18:20:03 +08:00