3 ms·
It can always crash when there is not enough memory. Especially on the stack. On of the test cases has 100000 [ and my own JSON parser crashed on them, becaus
by benibela 10y ago
It can always crash when there is not enough memory.
Especially on the stack.
On of the test cases has 100000 [ and my own JSON parser crashed on them, because it parsed recursively and the stack overflowed. So now I have fixed it to parse iteratively.
It still crashes.
Big surprise. Turns out the array destructor is also recursive, because it deletes every element in the array. So the array destructor crashes at some random point, after the parser has worked correctly.