A million element byte array segfaults
This commit is contained in:
committed by
alexander-gorshenev
parent
725512ad96
commit
5627688390
@@ -419,4 +419,10 @@ task array_list1(type: RunKonanTest) {
|
||||
goldValue = "OK\n"
|
||||
source = "runtime/collections/array_list1.kt"
|
||||
}
|
||||
/*
|
||||
task moderately_large_array(type: RunKonanTest) {
|
||||
goldValue = "OK\n"
|
||||
source = "runtime/collections/moderately_large_array.kt"
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val a = ByteArray(1000000)
|
||||
|
||||
var sum = 0
|
||||
for (b in a) {
|
||||
sum += b
|
||||
}
|
||||
|
||||
println(sum)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user