This challenge involves an old version of CS:GO VScript, which is vulnerable to a UAF bug and a type confusion bug.
The sort function of squirrel array is array_sort in sqbaselib.cpp, which will call _qsort:
// v: VM, o: array object, func: compare func