mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-09 16:35:13 +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
|
|
@ -117,10 +117,7 @@ int cellFsSdataOpen(u32 path_addr, int flags, mem32_t fd, mem32_t arg, u64 size)
|
|||
sys_fs->Warning("cellFsSdataOpen(path=\"%s\", flags=0x%x, fd_addr=0x%x, arg_addr=0x%x, size=0x%llx) -> cellFsOpen()",
|
||||
path.c_str(), flags, fd.GetAddr(), arg.GetAddr(), size);
|
||||
|
||||
/*if (!fd.IsGood() || (!arg.IsGood() && size))
|
||||
return CELL_EFAULT;
|
||||
|
||||
if (flags != CELL_O_RDONLY)
|
||||
/*if (flags != CELL_O_RDONLY)
|
||||
return CELL_EINVAL;
|
||||
|
||||
std::string suffix = path.substr(path.length() - 5, 5);
|
||||
|
|
@ -198,11 +195,6 @@ int cellFsAioRead(mem_ptr_t<CellFsAio> aio, mem32_t aio_id, mem_func_ptr_t<void
|
|||
{
|
||||
sys_fs->Warning("cellFsAioRead(aio_addr=0x%x, id_addr=0x%x, func_addr=0x%x)", aio.GetAddr(), aio_id.GetAddr(), func.GetAddr());
|
||||
|
||||
if (!aio.IsGood() || !aio_id.IsGood() || !func.IsGood())
|
||||
{
|
||||
return CELL_EFAULT;
|
||||
}
|
||||
|
||||
if (!aio_init)
|
||||
{
|
||||
return CELL_ENXIO;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue