Browse Source

Make sure to zero out new dynarrays

This fixes problems where nested dynarrays could end up trying to read
garbage pointers
master
Macoy Madson 5 months ago
parent
commit
ddc94768b7
  1. 2
      src/DynamicArray.cake

2
src/DynamicArray.cake

@ -366,6 +366,8 @@
(dynarray-set-length-with-element-size dynarray-dest
(path (path field > field-type-metadata) > struct-size)
num-elements-src)
(memset (deref dynarray-dest) 0 (* num-elements-src
(path (path field > field-type-metadata) > struct-size)))
(each-in-range num-elements-src i
(var current-element-dest (* void)

Loading…
Cancel
Save