From 7f6b76b34c9c4ab873802b7ee19ec417ef60dc46 Mon Sep 17 00:00:00 2001 From: cui Date: Fri, 27 Mar 2026 17:19:35 +0800 Subject: [PATCH] fixes #25671; commands: fix --maxLoopIterationsVM positive check (#25672) Fixes bug #25671. The previous condition `not value > 0` was parsed as `(not value) > 0`, not `not (value > 0)`, so the check did not reliably enforce a positive `--maxLoopIterationsvm` limit. Align with `--maxcalldepthvm` by using `value <= 0`. --- compiler/commands.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/commands.nim b/compiler/commands.nim index 3d2aabdc03..be5a8abd27 100644 --- a/compiler/commands.nim +++ b/compiler/commands.nim @@ -951,7 +951,7 @@ proc processSwitch*(switch, arg: string, pass: TCmdLinePass, info: TLineInfo; expectArg(conf, switch, arg, pass, info) var value: int = 10_000_000 discard parseSaturatedNatural(arg, value) - if not value > 0: localError(conf, info, "maxLoopIterationsVM must be a positive integer greater than zero") + if value <= 0: localError(conf, info, "maxLoopIterationsVM must be a positive integer greater than zero") conf.maxLoopIterationsVM = value of "maxcalldepthvm": expectArg(conf, switch, arg, pass, info)