Optimize infinite recursion backtraces