[x,k]=gsort(%nan+ones(1000,1)) crashes Scilab
Reported by Stéphane MOTTELET (@mottelet)
BUG DESCRIPTION:
----------------
gsort does not like %nan.
HOW TO REPRODUCE THE BUG:
-------------------------
n=7;
[x,k]=gsort(%nan+ones(n,1))
crashes Scilab as soon as n>=7 with the following message:
scilab-bin(34224,0x7fffadc8e340) malloc: *** error for object 0x7fca6edcba28: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug
but does not crash with n<7. Moreover, the following variants (without storing index output) never crash for any n
gsort(%nan+ones(n,1));
x=gsort(%nan+ones(n,1));
Seems to be related to bug #15522