[Mesa-dev] [PATCH 02/11] nir: Handle NULL in nir_copy_deref()

Kristian Høgsberg krh at bitplanet.net
Wed May 11 19:22:35 UTC 2016


From: Kristian Høgsberg Kristensen <krh at bitplanet.net>

Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>

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

diff --git a/src/compiler/nir/nir.c b/src/compiler/nir/nir.c
index 867a43c..f15c993 100644
--- a/src/compiler/nir/nir.c
+++ b/src/compiler/nir/nir.c
@@ -642,6 +642,9 @@ copy_deref_struct(void *mem_ctx, nir_deref_struct *deref)
 nir_deref *
 nir_copy_deref(void *mem_ctx, nir_deref *deref)
 {
+   if (deref == NULL)
+      return NULL;
+
    switch (deref->deref_type) {
    case nir_deref_type_var:
       return &copy_deref_var(mem_ctx, nir_deref_as_var(deref))->deref;
-- 
2.5.0



More information about the mesa-dev mailing list