From 50c24c3ff34882864b74862abdbaa5d7dcd8730d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kristian=20H=C3=B8gsberg=20Kristensen?= Date: Tue, 10 May 2016 15:08:38 -0700 Subject: [PATCH] nir: Handle NULL in nir_copy_deref() Reviewed-by: Jordan Justen Reviewed-by: Jason Ekstrand --- 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 c9db52ff23d..2741eb6581b 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 ©_deref_var(mem_ctx, nir_deref_as_var(deref))->deref; -- 2.30.2