Mercurial > vim
comparison src/vim9execute.c @ 19459:423b27246383 v8.2.0287
patch 8.2.0287: Vim9: return in try block not tested; catch not tested
Commit: https://github.com/vim/vim/commit/f575adff06d4bc5f670939567ce86974683deb7a
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Feb 20 20:41:06 2020 +0100
patch 8.2.0287: Vim9: return in try block not tested; catch not tested
Problem: Vim9: return in try block not tested; catch with pattern not
tested.
Solution: Add tests. Make it work.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 20 Feb 2020 20:45:03 +0100 |
parents | 655631882288 |
children | 798fce18d049 |
comparison
equal
deleted
inserted
replaced
19458:a9a0354cf324 | 19459:423b27246383 |
---|---|
1063 ++ectx.ec_trystack.ga_len; | 1063 ++ectx.ec_trystack.ga_len; |
1064 ++trylevel; | 1064 ++trylevel; |
1065 trycmd->tcd_frame = ectx.ec_frame; | 1065 trycmd->tcd_frame = ectx.ec_frame; |
1066 trycmd->tcd_catch_idx = iptr->isn_arg.try.try_catch; | 1066 trycmd->tcd_catch_idx = iptr->isn_arg.try.try_catch; |
1067 trycmd->tcd_finally_idx = iptr->isn_arg.try.try_finally; | 1067 trycmd->tcd_finally_idx = iptr->isn_arg.try.try_finally; |
1068 trycmd->tcd_caught = FALSE; | |
1068 } | 1069 } |
1069 break; | 1070 break; |
1070 | 1071 |
1071 case ISN_PUSHEXC: | 1072 case ISN_PUSHEXC: |
1072 if (current_exception == NULL) | 1073 if (current_exception == NULL) |
1107 { | 1108 { |
1108 --trystack->ga_len; | 1109 --trystack->ga_len; |
1109 --trylevel; | 1110 --trylevel; |
1110 trycmd = ((trycmd_T *)trystack->ga_data) | 1111 trycmd = ((trycmd_T *)trystack->ga_data) |
1111 + trystack->ga_len; | 1112 + trystack->ga_len; |
1112 if (trycmd->tcd_caught) | 1113 if (trycmd->tcd_caught && current_exception != NULL) |
1113 { | 1114 { |
1114 // discard the exception | 1115 // discard the exception |
1115 if (caught_stack == current_exception) | 1116 if (caught_stack == current_exception) |
1116 caught_stack = caught_stack->caught; | 1117 caught_stack = caught_stack->caught; |
1117 discard_current_exception(); | 1118 discard_current_exception(); |