[Mesa-dev] [PATCH 1/3] i965/cfg: Assert that cur_do/while/if pointers are non-NULL.

Jordan Justen jordan.l.justen at intel.com
Mon Jun 22 15:49:06 PDT 2015


Series Reviewed-by: Jordan Justen <jordan.l.justen at intel.com>

On 2015-06-22 14:56:06, Matt Turner wrote:
> Coverity sees that the functions immediately below the new assertions
> dereference these pointers, but is unaware that an ENDIF always follows
> an IF, etc.
> ---
>  src/mesa/drivers/dri/i965/brw_cfg.cpp | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_cfg.cpp b/src/mesa/drivers/dri/i965/brw_cfg.cpp
> index 39c419b..f1f230e 100644
> --- a/src/mesa/drivers/dri/i965/brw_cfg.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_cfg.cpp
> @@ -231,6 +231,7 @@ cfg_t::cfg_t(exec_list *instructions)
>           if (cur_else) {
>              cur_else->add_successor(mem_ctx, cur_endif);
>           } else {
> +            assert(cur_if != NULL);
>              cur_if->add_successor(mem_ctx, cur_endif);
>           }
>  
> @@ -299,6 +300,7 @@ cfg_t::cfg_t(exec_list *instructions)
>           inst->exec_node::remove();
>           cur->instructions.push_tail(inst);
>  
> +         assert(cur_do != NULL && cur_while != NULL);
>          cur->add_successor(mem_ctx, cur_do);
>          set_next_block(&cur, cur_while, ip);
>  
> -- 
> 2.3.6
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list