Skip to content
Permalink
Browse files
Merge pull request #6422 from sepalani/nullptr-blank
HLE: Improve format string detection heuristic
  • Loading branch information
leoetlino committed Mar 8, 2018
2 parents d296673 + 4f1c0ca commit 1eae5fe
Showing 1 changed file with 4 additions and 2 deletions.
@@ -47,8 +47,10 @@ void HLE_GeneralDebugPrint(ParameterType parameter_type)
{
std::string report_message;

// Is gpr3 pointing to a pointer rather than an ASCII string
if (PowerPC::HostIsRAMAddress(GPR(3)) && PowerPC::HostIsRAMAddress(PowerPC::HostRead_U32(GPR(3))))
// Is gpr3 pointing to a pointer (including nullptr) rather than an ASCII string
if (PowerPC::HostIsRAMAddress(GPR(3)) &&
(PowerPC::HostIsRAMAddress(PowerPC::HostRead_U32(GPR(3))) ||
PowerPC::HostRead_U32(GPR(3)) == 0))
{
if (PowerPC::HostIsRAMAddress(GPR(4)))
{

0 comments on commit 1eae5fe

Please sign in to comment.