The index block was declared in the block loop instead of the segment
loop. Yet it's only initialised one time out of 128 there, so most of
the time we're accessing uninitialised memory.
It still appeared to work because that that block always occupied the
same spot in the stack. Only Clang's memory sanitiser and the TIS
interpreter caught this.
// a separate thread. All iterations must be done before we
// fill the next slice.
FOR_T(u32, segment, 0, s->nb_lanes) {
+ blk index_block;
u32 index_ctr = 1;
FOR_T (u32, block, pass_offset, segment_size) {
// Current and previous blocks
? segment_start + lane_size - 1
: segment_start + block - 1;
- blk index_block;
u64 index_seed;
if (constant_time) {
if (block == pass_offset || (block % 128) == 0) {