diff options
author | Christoph Bumiller <[email protected]> | 2011-08-19 16:57:30 +0200 |
---|---|---|
committer | Christoph Bumiller <[email protected]> | 2011-08-19 16:57:30 +0200 |
commit | 778997f9dfeffbcbeef52f7dfa93a9ebd40ff42f (patch) | |
tree | c697b1cf98b27f84cbf91987e4bd1073f1bdea90 | |
parent | e975e18bebb54b20f00c568e7870932402b79f8f (diff) |
nv50: fix potential null deref in insn modifer optimization pass
Bug introduced in 34980cd153050111edc545545ddff11f5b68347e.
-rw-r--r-- | src/gallium/drivers/nv50/nv50_pc_optimize.c | 6 |
1 files 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); } } |