new feature: --staticBoundChecks:on to enforce static array index checking (#10965)
This commit is contained in:
parent
ed263e174e
commit
3f29911a94
16 changed files with 152 additions and 50 deletions
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -10,8 +10,9 @@ proc check(a: TObj not nil) =
|
|||
proc doit() =
|
||||
var x : array[0..1, TObj]
|
||||
|
||||
if x[0] != nil:
|
||||
check(x[0])
|
||||
let y = x[0]
|
||||
if y != nil:
|
||||
check(y)
|
||||
|
||||
doit()
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
discard """
|
||||
errormsg: "can prove: i + 1 > 30"
|
||||
line: 21
|
||||
errormsg: "cannot prove (i)..(i) disjoint from (i + 1)..(i + 1)"
|
||||
line: 20
|
||||
"""
|
||||
|
||||
import threadpool
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
discard """
|
||||
errormsg: "(k)..(k) not disjoint from (k)..(k)"
|
||||
line: 23
|
||||
action: compile
|
||||
"""
|
||||
|
||||
# bug #1597
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
import tables
|
||||
|
||||
let dataEx* = {1: 2, 3: 4}.toTable
|
||||
import tables
|
||||
|
||||
let dataEx* = {1: 2, 3: 4}.toTable
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue