Add null check to handle empty block cases on block visitor
This commit is contained in:
parent
6f37aefd33
commit
67868899e4
1 changed files with 7 additions and 3 deletions
|
@ -43,11 +43,15 @@ namespace Ryujinx.Graphics.Shader.StructuredIr
|
||||||
BlockEntered?.Invoke(this, new BlockVisitationEventArgs(Block));
|
BlockEntered?.Invoke(this, new BlockVisitationEventArgs(Block));
|
||||||
}
|
}
|
||||||
|
|
||||||
IAstNode next = Next(node);
|
//Node may be null, if the block is empty.
|
||||||
|
if (node != null)
|
||||||
|
{
|
||||||
|
IAstNode next = Next(node);
|
||||||
|
|
||||||
yield return node;
|
yield return node;
|
||||||
|
|
||||||
node = next;
|
node = next;
|
||||||
|
}
|
||||||
|
|
||||||
//We reached the end of the list, go up on tree to the parent blocks.
|
//We reached the end of the list, go up on tree to the parent blocks.
|
||||||
while (node == null && Block.Type != AstBlockType.Main)
|
while (node == null && Block.Type != AstBlockType.Main)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue