mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-02 09:30:11 +01:00
nv50/ir: Fix memory corruption in Function::orderInstructions().
"iter" doesn't reference a BasicBlock directly, but a Node::Graph, i.e. BasicBlock::get() is casting to the wrong pointer type.
This commit is contained in:
parent
ab382fbc35
commit
1829484458
1 changed files with 7 additions and 3 deletions
|
|
@ -323,10 +323,14 @@ unsigned int
|
|||
Function::orderInstructions(ArrayList &result)
|
||||
{
|
||||
Iterator *iter;
|
||||
for (iter = cfg.iteratorCFG(); !iter->end(); iter->next())
|
||||
for (Instruction *insn = BasicBlock::get(*iter)->getFirst();
|
||||
insn; insn = insn->next)
|
||||
for (iter = cfg.iteratorCFG(); !iter->end(); iter->next()) {
|
||||
BasicBlock *bb =
|
||||
BasicBlock::get(reinterpret_cast<Graph::Node *>(iter->get()));
|
||||
|
||||
for (Instruction *insn = bb->getFirst(); insn; insn = insn->next)
|
||||
result.insert(insn, insn->serial);
|
||||
}
|
||||
|
||||
cfg.putIterator(iter);
|
||||
return result.getSize();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue