Skip to content

Commit

Permalink
gpu: jit: add missing check in reorder_nary_add_args()
Browse files Browse the repository at this point in the history
  • Loading branch information
echeresh committed Apr 14, 2023
1 parent 663c2e4 commit 774deab
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/gpu/jit/pass/simplify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1499,7 +1499,8 @@ class common_factor_simplifier_t : public nary_op_mutator_t {

expr_t reorder_nary_add_args(const expr_t &e, bool x64_first) {
auto *nary_op = e.as_ptr<nary_op_t>();
if (nary_op->op_kind != op_kind_t::_add || nary_op->args.size() <= 2)
if (!nary_op || nary_op->op_kind != op_kind_t::_add
|| nary_op->args.size() <= 2)
return e;

std::vector<expr_t> other_args;
Expand Down

0 comments on commit 774deab

Please # to comment.