From a976a2b3aaabcd946b35d34a921c2148759b01bb Mon Sep 17 00:00:00 2001 From: glx22 Date: Sat, 4 Jan 2025 15:30:29 +0100 Subject: [PATCH] Fix: Properly check number of varaction2 ranges --- nml/actions/action2var.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nml/actions/action2var.py b/nml/actions/action2var.py index 875a1387..df4c1a4c 100644 --- a/nml/actions/action2var.py +++ b/nml/actions/action2var.py @@ -1277,6 +1277,9 @@ def parse_varaction2(switch_block): ) ) + if len(varaction2.ranges) > 255: + raise generic.ScriptError("Too many ranges.", varaction2.pos) + # Handle default result if switch_block.body.default is not None: # there is a default value