mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 05:18:08 +02:00
i965/cfg: Assert that cur_do/while/if pointers are non-NULL.
Coverity sees that the functions immediately below the new assertions dereference these pointers, but is unaware that an ENDIF always follows an IF, etc. Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
This commit is contained in:
parent
04758d25b4
commit
4d93a07c45
1 changed files with 2 additions and 0 deletions
|
|
@ -231,6 +231,7 @@ cfg_t::cfg_t(exec_list *instructions)
|
||||||
if (cur_else) {
|
if (cur_else) {
|
||||||
cur_else->add_successor(mem_ctx, cur_endif);
|
cur_else->add_successor(mem_ctx, cur_endif);
|
||||||
} else {
|
} else {
|
||||||
|
assert(cur_if != NULL);
|
||||||
cur_if->add_successor(mem_ctx, cur_endif);
|
cur_if->add_successor(mem_ctx, cur_endif);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -299,6 +300,7 @@ cfg_t::cfg_t(exec_list *instructions)
|
||||||
inst->exec_node::remove();
|
inst->exec_node::remove();
|
||||||
cur->instructions.push_tail(inst);
|
cur->instructions.push_tail(inst);
|
||||||
|
|
||||||
|
assert(cur_do != NULL && cur_while != NULL);
|
||||||
cur->add_successor(mem_ctx, cur_do);
|
cur->add_successor(mem_ctx, cur_do);
|
||||||
set_next_block(&cur, cur_while, ip);
|
set_next_block(&cur, cur_while, ip);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue