Euphoria
Ticket #911:
multiassign ioob and core dump
-
Reported by
petelomax
Jan 17, 2015
Matt reported that {a,b,c} = {1,2} crashes with an index out of bounds (which is fine) followed by a core dump (which is the bit that wants fixing).
For full details see http://openeuphoria.org/forum/m/126332.wc
Details
1. Comment by mattlewis
Jan 17, 2015
I've traced it to LookBackForSubscriptSymbol. The segfault is happening inside the condition for the while loop:
// find the previous subscript / slice
intptr_t *start_pc = pc;
--pc;
while( !(is_subs( *pc ) && ( (*(pc + sub_dest_offset( *pc )) == (intptr_t)sym ) ) ) || start_pc <= (pc + sub_dest_offset( *pc ) ) ){
--pc;
}
if( is_subs( *pc ) && ( (*(pc + sub_dest_offset( *pc )) == (intptr_t)sym ) ) ){
LookBackForSubscriptSymbol( pc, sublevel + 1, has_slice );
}
2. Comment by mattlewis
Jan 18, 2015
See: hg:euphoria/rev/397036d9e22e
changeset: 6272:397036d9e22e parent: 6270:c6cd9d054411 user: Matt Lewis date: Sun Jan 18 11:41:51 2015 -0500 files: source/be_rterror.c tests/t_c_deseq_func.d/control.err tests/t_c_deseq_seq.d/control.err tests/t_c_deseq_seq.e description:
- desequencing shouldn't segfault when reporting index out of bounds error
- fixes ticket 911