[Mesa-dev] [PATCH 01/10] glsl: replace some asserts with unreachable when processing the ast

Timothy Arceri tarceri at itsqueeze.com
Tue Apr 10 04:34:26 UTC 2018


---
 src/compiler/glsl/ast_to_hir.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
index 168ab7eec2f..4d7383c580f 100644
--- a/src/compiler/glsl/ast_to_hir.cpp
+++ b/src/compiler/glsl/ast_to_hir.cpp
@@ -1396,7 +1396,7 @@ ast_expression::do_hir(exec_list *instructions,
 
    switch (this->oper) {
    case ast_aggregate:
-      assert(!"ast_aggregate: Should never get here.");
+      unreachable("ast_aggregate: Should never get here.");
       break;
 
    case ast_assign: {
@@ -1973,14 +1973,14 @@ ast_expression::do_hir(exec_list *instructions,
    }
 
    case ast_unsized_array_dim:
-      assert(!"ast_unsized_array_dim: Should never get here.");
+      unreachable("ast_unsized_array_dim: Should never get here.");
       break;
 
    case ast_function_call:
       /* Should *NEVER* get here.  ast_function_call should always be handled
        * by ast_function_expression::hir.
        */
-      assert(0);
+      unreachable("ast_function_call: handled elsewhere ");
       break;
 
    case ast_identifier: {
-- 
2.17.0



More information about the mesa-dev mailing list