FIX (partially) #2703: bug in stack overflow handling when inside block