Mesa (master): nir: avoid segfault when ssa src not found

Timothy Arceri tarceri at kemper.freedesktop.org
Mon Aug 22 23:06:47 UTC 2016


Module: Mesa
Branch: master
Commit: 8ee909ee4261bc2d4396851c44219f07041cd85c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=8ee909ee4261bc2d4396851c44219f07041cd85c

Author: Timothy Arceri <timothy.arceri at collabora.com>
Date:   Sun Aug 21 18:31:40 2016 +1000

nir: avoid segfault when ssa src not found

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 at intel.com>

---

 src/compiler/nir/nir_validate.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/compiler/nir/nir_validate.c b/src/compiler/nir/nir_validate.c
index d0c9be2..60af715 100644
--- a/src/compiler/nir/nir_validate.c
+++ b/src/compiler/nir/nir_validate.c
@@ -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 &&




More information about the mesa-commit mailing list