Mercurial > vim
comparison src/vim9execute.c @ 20301:e1a8d2040bd7 v8.2.0706
patch 8.2.0706: Vim9: using assert_fails() causes function to finish
Commit: https://github.com/vim/vim/commit/8a1c1013153a7f08e014facac883a1987985d6db
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu May 7 14:07:25 2020 +0200
patch 8.2.0706: Vim9: using assert_fails() causes function to finish
Problem: Vim9: using assert_fails() causes function to finish.
Solution: Check did_emsg instead of called_emsg.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 07 May 2020 14:15:04 +0200 |
parents | 5f0611bc6377 |
children | 7587d892c00c |
comparison
equal
deleted
inserted
replaced
20300:24252e7f14c4 | 20301:e1a8d2040bd7 |
---|---|
456 static int | 456 static int |
457 call_bfunc(int func_idx, int argcount, ectx_T *ectx) | 457 call_bfunc(int func_idx, int argcount, ectx_T *ectx) |
458 { | 458 { |
459 typval_T argvars[MAX_FUNC_ARGS]; | 459 typval_T argvars[MAX_FUNC_ARGS]; |
460 int idx; | 460 int idx; |
461 int called_emsg_before = called_emsg; | 461 int did_emsg_before = did_emsg; |
462 | 462 |
463 if (call_prepare(argcount, argvars, ectx) == FAIL) | 463 if (call_prepare(argcount, argvars, ectx) == FAIL) |
464 return FAIL; | 464 return FAIL; |
465 | 465 |
466 // Call the builtin function. | 466 // Call the builtin function. |
468 | 468 |
469 // Clear the arguments. | 469 // Clear the arguments. |
470 for (idx = 0; idx < argcount; ++idx) | 470 for (idx = 0; idx < argcount; ++idx) |
471 clear_tv(&argvars[idx]); | 471 clear_tv(&argvars[idx]); |
472 | 472 |
473 if (called_emsg != called_emsg_before) | 473 if (did_emsg != did_emsg_before) |
474 return FAIL; | 474 return FAIL; |
475 return OK; | 475 return OK; |
476 } | 476 } |
477 | 477 |
478 /* | 478 /* |