From db3436394710f1344cab6087a37782425bed9d18 Mon Sep 17 00:00:00 2001 From: jedel1043 Date: Tue, 27 Feb 2024 08:31:53 -0600 Subject: [PATCH] Check that `min <= max` in `clamp_finite` --- core/engine/src/value/integer.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/core/engine/src/value/integer.rs b/core/engine/src/value/integer.rs index a81b63c058b..0218fb95bc7 100644 --- a/core/engine/src/value/integer.rs +++ b/core/engine/src/value/integer.rs @@ -22,6 +22,7 @@ impl IntegerOrInfinity { /// Panics if `min > max`. #[must_use] pub fn clamp_finite(self, min: i64, max: i64) -> i64 { + assert!(min <= max); match self { Self::Integer(i) => i.clamp(min, max), Self::PositiveInfinity => max,