api helpers: Save/restore more values in try_enter/try_leave

This fixes memory leak reported by ASAN. This also somehow fixes test40, though 
I have no idea why except that that test yields memory leak report.
This commit is contained in:
ZyX
2017-07-16 22:03:31 +03:00
parent 3660535f02
commit 2a6423eba7
4 changed files with 14 additions and 3 deletions

View File

@@ -565,6 +565,8 @@ static void discard_exception(except_T *excp, int was_finished)
void discard_current_exception(void)
{
discard_exception(current_exception, FALSE);
// Note: all globals manipulated here should be saved/restored in
// try_enter/try_leave.
current_exception = NULL;
did_throw = FALSE;
need_rethrow = FALSE;