diff options
author | Ian Romanick <[email protected]> | 2019-07-15 15:18:47 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2019-10-17 15:07:01 -0700 |
commit | 050e4e28bf7c86e2fc78b9e4dbaf285db1ed4b43 (patch) | |
tree | 3fb3afaebd8f63e4ccd0ffbbf86a57593dabc266 /src/compiler/nir | |
parent | da10fa9d63675dcdd789827cdb5b082140ec0621 (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")
Diffstat (limited to 'src/compiler/nir')
-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 a52104c7109..90ba897742d 100644 --- a/src/compiler/nir/nir_search_helpers.h +++ b/src/compiler/nir/nir_search_helpers.h @@ -209,7 +209,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 |