diff src/userfunc.c @ 13096:30f9a62f5f51 v8.0.1423

patch 8.0.1423: error in return not caught by try/catch commit https://github.com/vim/vim/commit/fabaf753e26df5a89a854673d14c15a1fa6b321a Author: Bram Moolenaar <Bram@vim.org> Date: Sat Dec 23 17:26:11 2017 +0100 patch 8.0.1423: error in return not caught by try/catch Problem: Error in return not caught by try/catch. Solution: Call update_force_abort(). (Yasuhiro Matsomoto, closes https://github.com/vim/vim/issues/2483)
author Christian Brabandt <cb@256bit.org>
date Sat, 23 Dec 2017 17:30:05 +0100
parents 41e46caf1030
children ac42c4b11dbc
line wrap: on
line diff
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -2972,6 +2972,9 @@ ex_return(exarg_T *eap)
     /* It's safer to return also on error. */
     else if (!eap->skip)
     {
+	/* In return statement, cause_abort should be force_abort. */
+	update_force_abort();
+
 	/*
 	 * Return unless the expression evaluation has been cancelled due to an
 	 * aborting error, an interrupt, or an exception.