Commit a6275b6
Nat
Bug repro, compiled iteration over uninitialized ListOf(bool)
Strange behavior observed when iterating through a list of bools which
was created with .setSizeUnsafe(N), so full of garbage data.
Outside of the compiler, or when using the builtin sum(), the iteration
gives the expected answer, the number of True values in the garbage data.
Inside a simple Entrypointed function to count Trues, we get a
ludicrously large answer (bigger than N).
Running the same function with some extra added statements for no
purpose (could be almost anything more than "pass"), we instead get 0.
The compiler seems to know to replace uninitialized data with False.1 parent 8c2c809 commit a6275b6
1 file changed
+35
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
0 commit comments