Checklist
Description
Analyzer message: V595 The chunkIds pointer was utilized before it was verified against nullptr. Check lines: 173, 179.
A probable error or strange code that requires a unification.
s32 PS4_SYSV_ABI scePlayGoGetProgress(/*.... */ const OrbisPlayGoChunkId* chunkIds, ....
{
LOG_DEBUG(Lib_PlayGo, "called handle = {}, chunkIds = {}, numberOfEntries = {}",
handle,
*chunkIds, numberOfEntries);
if (handle != PlaygoHandle) {
return ORBIS_PLAYGO_ERROR_BAD_HANDLE;
}
if (chunkIds == nullptr || outProgress == nullptr) {
return ORBIS_PLAYGO_ERROR_BAD_POINTER;
}
....
}
macros transforms to:
do {
if (auto logger = Common::Log::ALL_LOGGERS[Common::Log::Class::Lib_PlayGo]) {
logger->log(
spdlog::level::debug,
"[{}] <{}> ({}) {}:{} {}: "
"called handle = {}, chunkIds = {}, numberOfEntries = {}",
Common::Log::Class::Lib_PlayGo,
Common::Log::to_string_view(spdlog::level::debug),
Common::GetCurrentThreadName(),
spdlog::source_loc::basename(
"D:\\Project\\shadPS4\\shadPS4\\src\\core\\libraries\\playgo\\playgo.cpp"),
174, std::string_view(__func__) == "operator()" ? "lambda" : __func__, handle,
*chunkIds, numberOfEntries);
}
} while (false);
Link to an article with additional information: https://pvs-studio.com/en/blog/posts/cpp/1405/
Reason
Fixing potential bug and\or code quality.
Examples
No response
Checklist
Description
Analyzer message: V595 The
chunkIdspointer was utilized before it was verified against nullptr. Check lines: 173, 179.A probable error or strange code that requires a unification.
macros transforms to:
Link to an article with additional information: https://pvs-studio.com/en/blog/posts/cpp/1405/
Reason
Fixing potential bug and\or code quality.
Examples
No response