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

Commit fb956bd

Browse files
prigoyalnicolasvasilache
authored andcommitted
fix segfault in halide2isl for mod op
change makeIslAffBoundsFromExpr(..., e, ...) to makeIslAffBoundsFromExpr(..., op->a, ...) to avoid infinite recursion leading to segfault
1 parent 8d0781c commit fb956bd

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
@@ -203,7 +203,7 @@ std::vector<isl::aff> makeIslAffBoundsFromExpr(
203203
std::vector<isl::aff> result;
204204
// We cannot span multiple constraints if a modulo operation is involved.
205205
// x > max(a,b) % C is not equivalent to (x > a % C && x > b % C).
206-
auto lhs = makeIslAffBoundsFromExpr(space, e, false, false);
206+
auto lhs = makeIslAffBoundsFromExpr(space, op->a, false, false);
207207
CHECK_EQ(lhs.size(), 1u);
208208
if (const int64_t* b = as_const_int(op->b)) {
209209
return {lhs[0].mod(isl::val(space.get_ctx(), *b))};

0 commit comments

Comments
 (0)