nir: avoid segfault when ssa src not found
authorTimothy Arceri <timothy.arceri@collabora.com>
Sun, 21 Aug 2016 08:31:40 +0000 (18:31 +1000)
committerTimothy Arceri <timothy.arceri@collabora.com>
Mon, 22 Aug 2016 23:06:29 +0000 (09:06 +1000)
Without this the following line will segfault and we don't get to
see the results of the validate_assert() above.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
src/compiler/nir/nir_validate.c

index d0c9be2d8a9a29f18db3f9aa412e8e42f205bdf4..60af71550ba2ef29401a3a1fadf2d5de5168bb0a 100644 (file)
@@ -173,6 +173,9 @@ validate_ssa_src(nir_src *src, validate_state *state)
 
    validate_assert(state, entry);
 
+   if (!entry)
+      return;
+
    ssa_def_validate_state *def_state = (ssa_def_validate_state *)entry->data;
 
    validate_assert(state, def_state->where_defined == state->impl &&