From 5245d845b6f77361f01a7f577e1471345df132de Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Wed, 18 May 2016 11:40:34 -0400 Subject: [PATCH] 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 Reviewed-by: Jason Ekstrand --- src/compiler/nir/nir_validate.c | 1 + 1 file changed, 1 insertion(+) 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)); -- 2.30.2