mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-10 00:45:37 +00:00
IsGood() check elimination
Reasons: 1) It's unsafe - we cannot guarantee that address is still good while it is used. 2) It's wrong in many modules which are usually just compare pointer with zero.
This commit is contained in:
parent
48514b0e93
commit
8f04ab07ed
52 changed files with 104 additions and 1450 deletions
|
|
@ -60,13 +60,13 @@ void sys_game_process_exitspawn(
|
|||
std::vector<std::string> env;
|
||||
|
||||
mem_ptr_t<u32> argvp(argv_addr);
|
||||
while (argvp.GetAddr() && argvp.IsGood() && *argvp)
|
||||
while (argvp.GetAddr() && *argvp)
|
||||
{
|
||||
argv.push_back(Memory.ReadString(Memory.Read32(argvp.GetAddr())));
|
||||
argvp++;
|
||||
}
|
||||
mem_ptr_t<u32> envp(envp_addr);
|
||||
while (envp.GetAddr() && envp.IsGood() && *envp)
|
||||
while (envp.GetAddr() && *envp)
|
||||
{
|
||||
env.push_back(Memory.ReadString(Memory.Read32(envp.GetAddr())));
|
||||
envp++;
|
||||
|
|
@ -108,13 +108,13 @@ void sys_game_process_exitspawn2(
|
|||
std::vector<std::string> env;
|
||||
|
||||
mem_ptr_t<u32> argvp(argv_addr);
|
||||
while (argvp.GetAddr() && argvp.IsGood() && *argvp)
|
||||
while (argvp.GetAddr() && *argvp)
|
||||
{
|
||||
argv.push_back(Memory.ReadString(Memory.Read32(argvp.GetAddr())));
|
||||
argvp++;
|
||||
}
|
||||
mem_ptr_t<u32> envp(envp_addr);
|
||||
while (envp.GetAddr() && envp.IsGood() && *envp)
|
||||
while (envp.GetAddr() && *envp)
|
||||
{
|
||||
env.push_back(Memory.ReadString(Memory.Read32(envp.GetAddr())));
|
||||
envp++;
|
||||
|
|
@ -137,9 +137,6 @@ s32 sys_process_get_number_of_object(u32 object, mem32_t nump)
|
|||
{
|
||||
sc_p.Warning("sys_process_get_number_of_object(object=%d, nump_addr=0x%x)",
|
||||
object, nump.GetAddr());
|
||||
|
||||
if (!nump.IsGood())
|
||||
return CELL_EFAULT;
|
||||
|
||||
switch(object)
|
||||
{
|
||||
|
|
@ -234,9 +231,6 @@ s32 sys_process_get_sdk_version(u32 pid, mem32_t version)
|
|||
{
|
||||
sc_p.Warning("sys_process_get_sdk_version(pid=%d, version_addr=0x%x)", pid, version.GetAddr());
|
||||
|
||||
if (!version.IsGood())
|
||||
return CELL_EFAULT;
|
||||
|
||||
version = 0x360001; // TODO
|
||||
return CELL_OK;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue