summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir/nir_validate.c
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2016-05-18 11:40:34 -0400
committerRob Clark <[email protected]>2016-05-23 10:14:50 -0400
commit5245d845b6f77361f01a7f577e1471345df132de (patch)
tree057cdf6f8b13200445f6a4c49fe73e45faa080cf /src/compiler/nir/nir_validate.c
parent0cbc90c57cfc6099b529c5caeb58f385735ba75f (diff)
nir/validate: fix null deref coverity warning
CID 1265536 (#1 of 2): Explicit null dereferenced (FORWARD_NULL)6. var_deref_op: Dereferencing null pointer parent. Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir_validate.c')
-rw-r--r--src/compiler/nir/nir_validate.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/compiler/nir/nir_validate.c b/src/compiler/nir/nir_validate.c
index 8ac55d5e5bc..35bb162ac7f 100644
--- a/src/compiler/nir/nir_validate.c
+++ b/src/compiler/nir/nir_validate.c
@@ -376,6 +376,7 @@ validate_deref_chain(nir_deref *deref, validate_state *state)
break;
case nir_deref_type_struct:
+ assume(parent); /* cannot happen: deref change starts w/ nir_deref_var */
validate_assert(state, deref->type ==
glsl_get_struct_field(parent->type,
nir_deref_as_struct(deref)->index));