Skip to content

Commit

Permalink
Merge pull request #993 from phire/fix_getOpInfo
Browse files Browse the repository at this point in the history
GetOpInfo: Assert on all invalid Ops.
  • Loading branch information
skidau committed Sep 6, 2014
2 parents 7a1eca1 + 23b5411 commit a8f724e
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions Source/Core/Core/PowerPC/PPCTables.cpp
Expand Up @@ -41,25 +41,22 @@ GekkoOPInfo *GetOpInfo(UGeckoInstruction _inst)
int table = info->type>>24;
switch (table)
{
case 4: return m_infoTable4[_inst.SUBOP10];
case 19: return m_infoTable19[_inst.SUBOP10];
case 31: return m_infoTable31[_inst.SUBOP10];
case 59: return m_infoTable59[_inst.SUBOP5];
case 63: return m_infoTable63[_inst.SUBOP10];
case 4: info = m_infoTable4[_inst.SUBOP10]; break;
case 19: info = m_infoTable19[_inst.SUBOP10]; break;
case 31: info = m_infoTable31[_inst.SUBOP10]; break;
case 59: info = m_infoTable59[_inst.SUBOP5]; break;
case 63: info = m_infoTable63[_inst.SUBOP10]; break;
default:
_assert_msg_(POWERPC,0,"GetOpInfo - invalid subtable op %08x @ %08x", _inst.hex, PC);
return nullptr;
}
}
else
if ((info->type & 0xFFFFFF) == OPTYPE_INVALID)
{
if ((info->type & 0xFFFFFF) == OPTYPE_INVALID)
{
_assert_msg_(POWERPC,0,"GetOpInfo - invalid op %08x @ %08x", _inst.hex, PC);
return nullptr;
}
return m_infoTable[_inst.OPCD];
_assert_msg_(POWERPC,0,"GetOpInfo - invalid op %08x @ %08x", _inst.hex, PC);
return nullptr;
}
return info;
}

Interpreter::_interpreterInstruction GetInterpreterOp(UGeckoInstruction _inst)
Expand Down

1 comment on commit a8f724e

@CarlKenner
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This crashes (when I start Metroid Prime 2, haven't tested anything else) because info is NULL.
Please fix this.

Please sign in to comment.