From 0f925339e52e361946a1e894cfa6dbe494b39290 Mon Sep 17 00:00:00 2001 From: Arjun P Date: Thu, 6 Jan 2022 19:03:11 +0530 Subject: [PATCH] [MLIR] Simplex::normalizeRow: assert gcd is non-zero before dividing --- mlir/lib/Analysis/Presburger/Simplex.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/mlir/lib/Analysis/Presburger/Simplex.cpp b/mlir/lib/Analysis/Presburger/Simplex.cpp index 3d63ebd..ad1e019d 100644 --- a/mlir/lib/Analysis/Presburger/Simplex.cpp +++ b/mlir/lib/Analysis/Presburger/Simplex.cpp @@ -132,6 +132,7 @@ void SimplexBase::normalizeRow(unsigned row) { // Note that the gcd can never become zero since the first element of the row, // the denominator, is non-zero. + assert(gcd != 0); for (unsigned col = 0; col < nCol; ++col) tableau(row, col) /= gcd; } -- 2.7.4