Skip to content
This repository was archived by the owner on Apr 28, 2023. It is now read-only.

Commit 644de66

Browse files
committed
fix segfault in halide2isl for mod op
change makeIslAffBoundsFromExpr(..., e, ...) to makeIslAffBoundsFromExpr(..., op->a, ...) to avoid infinite recursion leading to segfault
1 parent 0398b9c commit 644de66

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tc/core/halide2isl.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ std::vector<isl::aff> makeIslAffBoundsFromExpr(
201201
std::vector<isl::aff> result;
202202
// We cannot span multiple constraints if a modulo operation is involved.
203203
// x > max(a,b) % C is not equivalent to (x > a % C && x > b % C).
204-
auto lhs = makeIslAffBoundsFromExpr(space, e, false, false);
204+
auto lhs = makeIslAffBoundsFromExpr(space, op->a, false, false);
205205
CHECK_EQ(lhs.size(), 1u);
206206
if (const int64_t* b = as_const_int(op->b)) {
207207
return {lhs[0].mod(isl::val(space.get_ctx(), *b))};

0 commit comments

Comments
 (0)