From 778997f9dfeffbcbeef52f7dfa93a9ebd40ff42f Mon Sep 17 00:00:00 2001 From: Christoph Bumiller Date: Fri, 19 Aug 2011 16:57:30 +0200 Subject: [PATCH] nv50: fix potential null deref in insn modifer optimization pass Bug introduced in 34980cd153050111edc545545ddff11f5b68347e. --- src/gallium/drivers/nv50/nv50_pc_optimize.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/nv50/nv50_pc_optimize.c b/src/gallium/drivers/nv50/nv50_pc_optimize.c index a1590c2dc6b..4271731efa7 100644 --- a/src/gallium/drivers/nv50/nv50_pc_optimize.c +++ b/src/gallium/drivers/nv50/nv50_pc_optimize.c @@ -462,8 +462,10 @@ nv_pass_lower_mods(struct nv_pass *ctx, struct nv_basic_block *b) mi->saturate = 1; mi->def[0] = nvi->def[0]; mi->def[0]->insn = mi; - mi->flags_def = nvi->flags_def; - mi->flags_def->insn = mi; + if (nvi->flags_def) { + mi->flags_def = nvi->flags_def; + mi->flags_def->insn = mi; + } nv_nvi_delete(nvi); } } -- 2.30.2