Skip to content

Commit 4301744

Browse files
committed
raise the max instruction count for the VM to one billion
1 parent e39f2a9 commit 4301744

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727

2828
### Compiler changes
2929

30+
- The VM's instruction count limit was raised to 1 billion instructions in order
31+
to support more complex computations at compile-time.
32+
33+
3034
### Bugfixes
3135

3236
- The `importcpp` pragma now allows importing the listed fields of generic

compiler/msgs.nim

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,9 @@ const
357357
errXExpectsTwoArguments: "\'$1\' expects two arguments",
358358
errXExpectsObjectTypes: "\'$1\' expects object types",
359359
errXcanNeverBeOfThisSubtype: "\'$1\' can never be of this subtype",
360-
errTooManyIterations: "interpretation requires too many iterations",
360+
errTooManyIterations: "interpretation requires too many iterations; " &
361+
"if you are sure this is not a bug in your code edit " &
362+
"compiler/vmdef.MaxLoopIterations and rebuild the compiler",
361363
errCannotInterpretNodeX: "cannot evaluate \'$1\'",
362364
errFieldXNotFound: "field \'$1\' cannot be found",
363365
errInvalidConversionFromTypeX: "invalid conversion from type \'$1\'",

compiler/vmdef.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const
1616
byteExcess* = 128 # we use excess-K for immediates
1717
wordExcess* = 32768
1818

19-
MaxLoopIterations* = 1500_000 # max iterations of all loops
19+
MaxLoopIterations* = 1_000_000_000 # max iterations of all loops
2020

2121

2222
type

0 commit comments

Comments
 (0)