Fix off-by-one in assert, allow Switch as first thing in function

This commit is contained in:
baldurk committed 2016-04-11 20:57:18 +02:00
1 parent df00fc95e7
commit 84dcd7b9ad
1 file changed
+1 -1
@@ -2275,7 +2275,7 @@ string SPVModule::Disassemble(const string &entryPoint)
{
if(funcops[l]->opcode == spv::OpSwitch)
{
RDCASSERT(l > 1 && funcops[l-1]->opcode == spv::OpSelectionMerge);
RDCASSERT(l > 0 && funcops[l-1]->opcode == spv::OpSelectionMerge);
switchstack.push_back(std::make_pair(funcops[l-1]->flow->targets[0], funcops[l]->flow));
}