Skip to content

Commit 774deab

Browse files
committed
gpu: jit: add missing check in reorder_nary_add_args()
1 parent 663c2e4 commit 774deab

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/gpu/jit/pass/simplify.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1499,7 +1499,8 @@ class common_factor_simplifier_t : public nary_op_mutator_t {
14991499

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

15051506
std::vector<expr_t> other_args;

0 commit comments

Comments
 (0)