From: Christoph Bumiller Date: Fri, 19 Aug 2011 14:57:30 +0000 (+0200) Subject: nv50: fix potential null deref in insn modifer optimization pass X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=778997f9dfeffbcbeef52f7dfa93a9ebd40ff42f;p=mesa.git nv50: fix potential null deref in insn modifer optimization pass Bug introduced in 34980cd153050111edc545545ddff11f5b68347e. --- 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); } }