[Mesa-dev] [PATCH] glsl: remove unreachable assert()

Timothy Arceri tarceri at itsqueeze.com
Wed Mar 28 21:14:54 UTC 2018


Reviewed-by: Timothy Arceri <tarceri at itsqueeze.com>

On 29/03/18 04:25, Emil Velikov wrote:
> From: Emil Velikov <emil.velikov at collabora.com>
> 
> Earlier commit enforced that we'll bail out if the number of terminators
> is different than 2. With that in mind, the assert() will never trigger.
> 
> Fixes: 56b867395de ("glsl: fix infinite loop caused by bug in loop
> unrolling pass")
> Cc: Timothy Arceri <tarceri at itsqueeze.com>
> Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
> ---
>   src/compiler/glsl/loop_unroll.cpp | 2 --
>   1 file changed, 2 deletions(-)
> 
> diff --git a/src/compiler/glsl/loop_unroll.cpp b/src/compiler/glsl/loop_unroll.cpp
> index f6efe6475a..874f418568 100644
> --- a/src/compiler/glsl/loop_unroll.cpp
> +++ b/src/compiler/glsl/loop_unroll.cpp
> @@ -528,8 +528,6 @@ loop_unroll_visitor::visit_leave(ir_loop *ir)
>      unsigned term_count = 0;
>      bool first_term_then_continue = false;
>      foreach_in_list(loop_terminator, t, &ls->terminators) {
> -      assert(term_count < 2);
> -
>         ir_if *ir_if = t->ir->as_if();
>         assert(ir_if != NULL);
>   
> 


More information about the mesa-dev mailing list