summary refs log tree commit diff stats
path: root/tests/vm
diff options
context:
space:
mode:
authorArne Döring <arne.doering@gmx.net>2019-08-04 19:31:55 +0200
committerAndreas Rumpf <rumpf_a@web.de>2019-08-04 19:31:55 +0200
commitb73d097d36d3fb3046fcb0c190c02684cd0c1867 (patch)
treeced037ba7d59b4dc76849f4aab1cd3a05f21b780 /tests/vm
parent343ace8194d6bcdeca6b4b4eba9b668a1737b625 (diff)
downloadNim-b73d097d36d3fb3046fcb0c190c02684cd0c1867.tar.gz
fixes #9829 (#11849)
Diffstat (limited to 'tests/vm')
-rw-r--r--tests/vm/tmaxloopiterations.nim15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/vm/tmaxloopiterations.nim b/tests/vm/tmaxloopiterations.nim
new file mode 100644
index 000000000..6334d1e6d
--- /dev/null
+++ b/tests/vm/tmaxloopiterations.nim
@@ -0,0 +1,15 @@
+discard """
+errormsg: "interpretation requires too many iterations; if you are sure this is not a bug in your code edit compiler/vmdef.MaxLoopIterations and rebuild the compiler"
+"""
+
+# issue #9829
+
+macro foo(): untyped  =
+  let lines = ["123", "5423"]
+  var idx = 0
+  while idx < lines.len():
+    if lines[idx].len() < 1:
+      inc(idx)
+      continue
+
+foo()