nir/spirv/cfg: Assert that blocks only ever get added once
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 5 Jan 2016 23:56:59 +0000 (15:56 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 5 Jan 2016 23:56:59 +0000 (15:56 -0800)
This effectively prevents infinite loops in cfg_walk_blocks.

src/glsl/nir/spirv/vtn_cfg.c

index a8e149a00a647119149e3cf79cd270e1a83aa4df..646b960d179d484543f148ec8ee5cc93204f6c72 100644 (file)
@@ -281,6 +281,7 @@ vtn_cfg_walk_blocks(struct vtn_builder *b, struct list_head *cf_list,
          continue;
       }
 
+      assert(block->node.link.next == NULL);
       list_addtail(&block->node.link, cf_list);
 
       switch (*block->branch & SpvOpCodeMask) {