You could test to disable the Stack reset in the configuration bits, that should prevent the MCU from doing a reset when doing a stack under- or overflow. Simple and easy but be aware that a return later in the code can make stange things. Page 253 in the manual if you want to look CONFIG4L register.