Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.13.2
-
cbf97ccf8bb46c720de01a79f39b335dc74db71b (qt/qtdeclarative/5.14)
Description
Here is another fun Array.sort crash, not unlike QTBUG-81106 (but this time on a simple non-sparse array). If I try to sort an array that contains a Symbol such as Symbol.iterator, the engine crashes.
const v4 = [Symbol.iterator, 1]; const v5 = v4.sort();
This appears to happen because the fallback code for the array element comparators (e.g. ArrayElementLessThan, here at qv4arraydata.cpp:660) assumes that the object can be converted to a string — and if it can't, it uses the resulting nullptr anyways and tries to call p1s->toQString() on it.