mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-11-04 13:07:32 +00:00
5.6 KiB
5.6 KiB
libSceJson2 technical debt
Unknown function info
- sce::Json::Parser::parse with a read callback (libSceJson2) - the callback's contract is taken from PPSA04540's: it returns 0 with the next character, and at the end of its data writes
'\0'and returns -1. Characters are read until the callback returns non-zero or gives'\0', and the text read is then parsed as by the(text, size)overload, so trailing characters after the value are rejected as there. Whether the console stops reading at the end of the top-level value, and what it returns when the callback fails before the end, are unknown - sce::Json::Parser::parse (libSceJson2) - a null text pointer or zero size returns
JsonErrorParse(0x80920101) without modifying the destination Value; whether the console distinguishes a null pointer from a syntax error with a separate parameter error code is unknown. A number that overflows a double (e.g.1e309) throws: whether the console rejects the document or stores an infinite real is unknown - sce::Json::InitParameter2, InitParameterRtti and InitParameterRtti2 (libSceJson2) - RTTI allocator adaptation and the
InitParameterRttilayout remain unverified.setAllocatorRttistores the raw allocation-parameter pointer as the allocator;initializeignores allocator, buffer-size and special-float settings. Special-float enum meanings and parser support for non-finite numbers remain unresolved; serialization of non-finite values throws. Setter return types remain unverified. - sce::Json::Object::Pair, sce::Json::Array::iterator and sce::Json::Object::iterator members (libSceJson2) - the signatures follow the mangled names, with
Array::iterator::operator++(int)andObject::iterator::operator++(int)returning their copy through a result pointer beforethisasbegindoes, since the iterators have non-trivial destructors.Pair(const String&, const Value&)and defaultPair()deep-copy or initialize into the layoutObjectiteration already hands out (key at 0, value at 0x10) and zeroes the 8 bytes between them; what the console keeps there is unknown. Default-constructed iterators are singular - sce::Json::Value::setTypeMismatchHandler, setElementAccessFailureHandler and setSpecialFloatHandler (libSceJson2) - members of
Valuethat return an int, inferred from a caller that registers them on its rootValuebefore parsing into it, with the handler and its context, and accepts 0 or 0x80848104 as success; they return 0. The PS Vita library'sValue::setNullAccessCallbackis such a member too (vitasdk). The handler signatures follow the mangled names. A handler applies to theValueit is set on and to the values thatValueholds then, andParser::parsegives the values it creates the handlers of theValueit parses into, since the title reads the errors its handlers record after accessing parsed members; copies,push_backandObject::operator[]do not carry them, and how the console finds the handler of an accessed value is unknown. A typed getter on a non-null value of another type calls the type mismatch handler with the requested type, the value, null and the context, and returns the value the handler returns if it has the requested type, else the getter's default; passing null as the third handler argument (the secondValuepointer), and the order of the twoValuepointers, remain unverified against the console. The element access failure handler is not called: a failedoperator[]orgetValueon a value carrying it throws, as the error code the console passes, which the title records as its error, is unknown; without one the access still reaches the null-access callback. The special float handler is not called: serializing a non-finite real throws with or without it, as theFunctionTypevalues and thebool*output are unknown, and the title's handler returns a different replacement for each of its two types - sce::Json::MemAllocator::notifyError (libSceJson2) - the base class's virtual does nothing. A title's allocator that does not override it calls it through its own vtable; the library never calls the title's allocator, so it never reports an allocation failure. Whether the console's base implementation logs anything is unknown
- sce::Json::String size, capacity, resize, compare and operator==(const String&), append(const char*, size_t), operator+=; Value::swap; Array::iterator and Object::iterator copy constructor, advance and operator== (libSceJson2) - the signatures follow the mangled names and the behaviour is that of the matching
std::stringor container operation, with no cited source in KytyPS5, shadPS4, SharpProspero or disassembly.append(text, length)throws on a null text with a non-zero length;operator+=returns the String;Value::swapexchanges the node pointers;advancemoves the iterator in place, returns it, and does not check the distance against the end. Whether the console returns the iterator fromadvanceand how it bounds it is unverified - sce::Json::Value::operator bool (libSceJson2) - callback dispatch before conversion is not implemented. The system library invokes the applicable type mismatch handler before converting a non-boolean value, with SDK-dependent global callback handling.