SPU LLVM: fix jt target duplication bug

This commit is contained in:
Nekotekina 2018-06-26 15:00:09 +03:00
parent a999bccc03
commit 8ad05ce10e

View file

@ -3979,10 +3979,16 @@ public:
{ {
if (m_block_info[target / 4]) if (m_block_info[target / 4])
{ {
targets.emplace(target, add_block(target)); targets.emplace(target, nullptr);
} }
} }
// Initialize target basic blocks
for (auto& pair : targets)
{
pair.second = add_block(pair.first);
}
// Get jump table bounds (optimization) // Get jump table bounds (optimization)
const u32 start = targets.begin()->first; const u32 start = targets.begin()->first;
const u32 end = targets.rbegin()->first + 4; const u32 end = targets.rbegin()->first + 4;