Skip to content

Commit 35abdd5

Browse files
authored
[Dana] Fix out of bounds integers in linemarket (#84)
1 parent 9373d0a commit 35abdd5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

dana/programs/linemarket.dana

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def main
1717
var stores size s f N tail is int
1818
var MAX_STORES MAX_PLACES is int
1919
var i is int
20-
var arr is int[200000]
20+
var arr is int[32767]
2121

2222
def swap: x y as ref int
2323
var t is int
@@ -45,7 +45,7 @@ def main
4545
var last_position placed_stores i_ps is int
4646
var j is int
4747
var position is int
48-
last_position := -1000000000
48+
last_position := -32768
4949
placed_stores := 0
5050
i_ps := 0
5151
loop:
@@ -91,8 +91,8 @@ def main
9191
return: result
9292

9393
tail := 0
94-
MAX_STORES := 1000000
95-
MAX_PLACES := 100000
94+
MAX_STORES := 32767
95+
MAX_PLACES := 32767
9696

9797
stores := readInteger()
9898
N := readInteger()

0 commit comments

Comments
 (0)