From 0e54562de48525cf8c2008df6557aabb3624b67c Mon Sep 17 00:00:00 2001 From: chriseth Date: Wed, 16 Feb 2022 17:05:00 +0100 Subject: [PATCH] Fix fuzzer bug. --- libsolutil/LP.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libsolutil/LP.cpp b/libsolutil/LP.cpp index 02da1fb96..41f1f5d34 100644 --- a/libsolutil/LP.cpp +++ b/libsolutil/LP.cpp @@ -74,8 +74,7 @@ struct Tableau /// Adds slack variables to remove non-equality costraints from a set of constraints /// and returns the data part of the tableau / constraints. -/// The second return variable is true if a non-equality constraint was -/// found and thus new variables have been added. +/// The second return variable is true if a the original input had any equality constraints. pair, bool> toEquationalForm(vector _constraints) { size_t varsNeeded = static_cast(ranges::count_if(_constraints, [](Constraint const& _c) { return !_c.equality; })); @@ -101,7 +100,7 @@ pair, bool> toEquationalForm(vector _constr for (Constraint& c: _constraints) data.emplace_back(move(c.data)); - return make_pair(move(data), varsNeeded > 0); + return make_pair(move(data), varsNeeded < _constraints.size()); } /// Finds the simplex pivot column: The column with the largest positive objective factor.