Skip to content

Commit

Permalink
RFC: nir: fix block iterator coverity warning
Browse files Browse the repository at this point in the history
For example, in nir_opt_dead_cf.c:140:

CID 1358914 (#1 of 1): Dereference null return value (NULL_RETURNS)13.
dereference: Dereferencing a null pointer block.
  • Loading branch information
freedreno-zz committed Jun 14, 2016
1 parent 1a8aae1 commit 35cb4ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/compiler/nir/nir.h
Original file line number Diff line number Diff line change
Expand Up @@ -2196,7 +2196,7 @@ nir_block *nir_cf_node_cf_tree_next(nir_cf_node *node);

#define nir_foreach_block_in_cf_node(block, node) \
for (nir_block *block = nir_cf_node_cf_tree_first(node); \
block != nir_cf_node_cf_tree_next(node); \
block && (block != nir_cf_node_cf_tree_next(node)); \
block = nir_block_cf_tree_next(block))

/* If the following CF node is an if, this function returns that if.
Expand Down

0 comments on commit 35cb4ce

Please sign in to comment.