summaryrefslogtreecommitdiffstats
path: root/src/compiler
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2019-07-15 15:18:47 -0700
committerDylan Baker <[email protected]>2019-10-18 09:55:58 -0700
commite958b35a40ff8f8c26d1890c53016df3061f65fc (patch)
tree2ee0adf1c6c21bf87a6f9907c36cda3d1eac14aa /src/compiler
parent16af8e977232dc1b546bea8a973725c341639577 (diff)
nir/search: Fix possible NULL dereference in is_fsign
Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]> Fixes: 09705747d72 ("nir/algebraic: Reassociate fadd into fmul in DPH-like pattern") (cherry picked from commit 050e4e28bf7c86e2fc78b9e4dbaf285db1ed4b43)
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/nir/nir_search_helpers.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/nir/nir_search_helpers.h b/src/compiler/nir/nir_search_helpers.h
index e2a436be6b7..7305e47aebb 100644
--- a/src/compiler/nir/nir_search_helpers.h
+++ b/src/compiler/nir/nir_search_helpers.h
@@ -203,7 +203,7 @@ is_fsign(nir_alu_instr *instr, unsigned src,
if (src_alu->op == nir_op_fneg)
src_alu = nir_src_as_alu_instr(src_alu->src[0].src);
- return src_alu->op == nir_op_fsign;
+ return src_alu != NULL && src_alu->op == nir_op_fsign;
}
static inline bool