r600/sfn: Don't use assert to test success of operation
authorGert Wollny <gert.wollny@collabora.com>
Tue, 12 Jul 2022 16:15:41 +0000 (18:15 +0200)
committerMarge Bot <emma+marge@anholt.net>
Tue, 12 Jul 2022 16:48:20 +0000 (16:48 +0000)
With that the actual call will be eliminated if the code is
compiled with NDEBUG.

Fixes: 79ca456b4837b3bc21cf9ef3c03c505c4b4909f6
  r600/sfn: rewrite NIR backend

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6832
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17496>

src/gallium/drivers/r600/sfn/sfn_shader.cpp

index 1f6e5df..7ee4562 100644 (file)
@@ -664,8 +664,8 @@ bool Shader::process_if(nir_if *if_stmt)
    }
 
    if (!child_block_empty(if_stmt->else_list)) {
-      assert(emit_control_flow(ControlFlowInstr::cf_else));
-
+      if (!emit_control_flow(ControlFlowInstr::cf_else))
+         return false;
       foreach_list_typed(nir_cf_node, n, node, &if_stmt->else_list)
             if (!process_cf_node(n)) return false;
    }