parser: better patch for stack overflow