Fixed `STACK_OVERFLOW` for recursive pattern