From 42026b18d7bed94f15358cfb11aedb704cc7810d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arpad=20B=C3=BCrmen?= Date: Thu, 25 Jan 2024 23:05:27 +0100 Subject: [PATCH] Fixed crash in debug when compiling $limit() Crash took place when compiling $limit(). It was caused by an incorrect assert. --- openvaf/hir/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openvaf/hir/src/lib.rs b/openvaf/hir/src/lib.rs index 1417728e..f1cf87be 100644 --- a/openvaf/hir/src/lib.rs +++ b/openvaf/hir/src/lib.rs @@ -227,7 +227,7 @@ impl Function { } pub fn arg(self, idx: usize, db: &CompilationDB) -> FunctionArg { - debug_assert!(db.function_data(self.id).args.len() <= idx); + debug_assert!(db.function_data(self.id).args.len() >= idx); FunctionArg { fun_id: self.id, arg_id: idx.into() } } pub fn args(self, db: &CompilationDB) -> impl Iterator + Clone {