From 0ac213667df1afbba3f66cb4fc3ec51073b9c158 Mon Sep 17 00:00:00 2001 From: Arjun P Date: Tue, 12 Apr 2022 13:04:56 +0100 Subject: [PATCH] [MLIR][Presburger] normalizeDiv: add assert that denom > 0 --- mlir/lib/Analysis/Presburger/Utils.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/mlir/lib/Analysis/Presburger/Utils.cpp b/mlir/lib/Analysis/Presburger/Utils.cpp index 77230fc825dc..d25d03447e9a 100644 --- a/mlir/lib/Analysis/Presburger/Utils.cpp +++ b/mlir/lib/Analysis/Presburger/Utils.cpp @@ -324,6 +324,7 @@ int64_t presburger::normalizeRange(MutableArrayRef range) { } void presburger::normalizeDiv(MutableArrayRef num, int64_t &denom) { + assert(denom > 0 && "denom must be positive!"); int64_t gcd = llvm::greatestCommonDivisor(gcdRange(num), denom); for (int64_t &coeff : num) coeff /= gcd;