• source navigation  • diff markup  • identifier search  • freetext search  • 

Sources/ucode/tests/custom/99_bugs/27_invalid_sparse_array_set

  1 When setting an array index which is beyond the end of the last currently
  2 preallocated chunk and not evenly divisible by the chunk size, the array
  3 entries list was not properly reallocated resulting in invalid memory
  4 writes.
  5 
  6 -- Testcase --
  7 {%
  8         for (i = 0; i < 32; i++) {
  9                 a = [];
 10                 a[i] = true;
 11                 print(length(a), "\n");
 12         }
 13 %}
 14 -- End --
 15 
 16 -- Expect stdout --
 17 1
 18 2
 19 3
 20 4
 21 5
 22 6
 23 7
 24 8
 25 9
 26 10
 27 11
 28 12
 29 13
 30 14
 31 15
 32 16
 33 17
 34 18
 35 19
 36 20
 37 21
 38 22
 39 23
 40 24
 41 25
 42 26
 43 27
 44 28
 45 29
 46 30
 47 31
 48 32
 49 -- End --

This page was automatically generated by LXR 0.3.1.  •  OpenWrt