summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir/nir_validate.c
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2016-05-18 11:43:15 -0400
committerRob Clark <[email protected]>2016-05-20 11:13:50 -0400
commitdf361fc58cb1aaf8c692c3aa6f545cf7f495b374 (patch)
tree41836fb177d4bed9c943d3193ed201592ff41884 /src/compiler/nir/nir_validate.c
parentfcd6b3f42be904d162b78fe75ba14c6415cdb815 (diff)
nir/validate: assume() that hashtable entry exists
At this point, it would require a logic error in nir_validate to not have already populated this hashtable entry, but coverity doesn't realize that: CID 1265547 (#1 of 1): Dereference null return value (NULL_RETURNS)3. dereference: Dereferencing a null pointer entry. CID 1271039 (#1 of 1): Dereference null return value (NULL_RETURNS)3. dereference: Dereferencing a null pointer entry. Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir_validate.c')
-rw-r--r--src/compiler/nir/nir_validate.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/compiler/nir/nir_validate.c b/src/compiler/nir/nir_validate.c
index b186fd5bf51..8ac55d5e5bc 100644
--- a/src/compiler/nir/nir_validate.c
+++ b/src/compiler/nir/nir_validate.c
@@ -879,6 +879,7 @@ postvalidate_reg_decl(nir_register *reg, validate_state *state)
{
struct hash_entry *entry = _mesa_hash_table_search(state->regs, reg);
+ assume(entry);
reg_validate_state *reg_state = (reg_validate_state *) entry->data;
nir_foreach_use(src, reg) {
@@ -955,6 +956,8 @@ postvalidate_ssa_def(nir_ssa_def *def, void *void_state)
validate_state *state = void_state;
struct hash_entry *entry = _mesa_hash_table_search(state->ssa_defs, def);
+
+ assume(entry);
ssa_def_validate_state *def_state = (ssa_def_validate_state *)entry->data;
nir_foreach_use(src, def) {