new feature: --staticBoundChecks:on to enforce static array index checking (#10965)

This commit is contained in:
Andreas Rumpf 2020-03-18 14:25:10 +01:00 • committed by GitHub
commit 3f29911a94
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 152 additions and 50 deletions

View file

@ -1,14 +1,14 @@
discard """
cmd: "nim c --gc:arc $file"
action: "compile"
"""
# bug #13269
import posix
proc foo*() =
var last = newSeq[Stat]()
var next = last
for i in 0..3:
last = next
foo()
discard """
cmd: "nim c --gc:arc $file"
action: "compile"
"""
# bug #13269
import posix
proc foo*() =
var last = newSeq[Stat]()
var next = last
for i in 0..3:
last = next
foo()