diff options
author | Ian Romanick <ian.d.romanick@intel.com> | 2019-07-15 15:18:47 -0700 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2019-08-06 11:10:23 -0700 |
commit | 37b78f7a15c24cf4dba649fa7f5345a247386831 (patch) | |
tree | 85951bc203f556969f0efbecdf1546b879144a22 | |
parent | 954224b7147e8197555856d9833e8cfb2342d4d5 (diff) |
nir/search: Fix possible NULL dereference in is_fsign
Fixes: 09705747d72 ("nir/algebraic: Reassociate fadd into fmul in DPH-like pattern")
-rw-r--r-- | src/compiler/nir/nir_search_helpers.h | 2 |
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 |