aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler
diff options
context:
space:
mode:
authorKristian Høgsberg Kristensen <[email protected]>2016-05-10 15:08:38 -0700
committerKristian Høgsberg Kristensen <[email protected]>2016-05-24 10:14:56 -0700
commit50c24c3ff34882864b74862abdbaa5d7dcd8730d (patch)
treefc050a493f38e30b8e12d7dc93bf45290b868a37 /src/compiler
parent29921ee987d8f2cc315c846dea958ab19b986ecd (diff)
nir: Handle NULL in nir_copy_deref()
Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/nir/nir.c3
1 files changed, 3 insertions, 0 deletions
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 &copy_deref_var(mem_ctx, nir_deref_as_var(deref))->deref;