mem:LRO bug; aliasing in recursive loop call has been overlooked
When compiling
int main()
{
def_chunk = with {} : genarray ([20], 0);
aa = def_chunk;
bb = def_chunk;
b,c = with {
( . <= iv < .) {
aa = def_chunk;
bb = def_chunk;
for (i=0; _lt_SxS_(i,4); i = _add_SxS_(i,1)) {
bb = with {
([2] <= ov <[19]) : _sel_VxA_(ov, aa) ;
} : modarray (bb);
tmp = aa;
aa = bb;
bb = tmp;
}
} : (aa, bb);
} : (genarray ([2], def_chunk),
genarray ([2], def_chunk));
return _sel_VxA_([0,0], b);
}
with
sac2c 1.3.3-MijasCosta-1036-g3a2ed
build-type: RELEASE
built-by: "sbs" at 2023-01-18T10:04:41
even when using -noemrl -noEMRCI -noEMRCF
produces
-sbs-SvenBodosAir2-> ./a.out
a.out(18695,0x7ff84562d8c0) malloc: *** error for object 0x600003178000: pointer being freed was not allocated
a.out(18695,0x7ff84562d8c0) malloc: *** set a breakpoint in malloc_error_break to debug
Abort