fix Issue 8313 - stack overflow on recursive ifti evaluation

https://d.puremagic.com/issues/show_bug.cgi?id=8313