comparison src/vim9compile.c @ 23543:f90e429453fd v8.2.2314

patch 8.2.2314: Vim9: returning zero takes two instructions Commit: https://github.com/vim/vim/commit/299f3036ec21cc9735846b2e0dfdfc5a78b26c1c Author: Bram Moolenaar <Bram@vim.org> Date: Fri Jan 8 20:53:09 2021 +0100 patch 8.2.2314: Vim9: returning zero takes two instructions Problem: Vim9: returning zero takes two instructions. Solution: Add ISN_RETURN_ZERO.
author Bram Moolenaar <Bram@vim.org>
date Fri, 08 Jan 2021 21:00:04 +0100
parents 7f0fc2ab90e3
children 5c094273c015
comparison
equal deleted inserted replaced
23542:4ad827c071b9 23543:f90e429453fd
8188 emsg(_(e_missing_return_statement)); 8188 emsg(_(e_missing_return_statement));
8189 goto erret; 8189 goto erret;
8190 } 8190 }
8191 8191
8192 // Return zero if there is no return at the end. 8192 // Return zero if there is no return at the end.
8193 generate_PUSHNR(&cctx, 0); 8193 generate_instr(&cctx, ISN_RETURN_ZERO);
8194 generate_instr(&cctx, ISN_RETURN);
8195 } 8194 }
8196 8195
8197 { 8196 {
8198 dfunc_T *dfunc = ((dfunc_T *)def_functions.ga_data) 8197 dfunc_T *dfunc = ((dfunc_T *)def_functions.ga_data)
8199 + ufunc->uf_dfunc_idx; 8198 + ufunc->uf_dfunc_idx;
8481 case ISN_PUSHF: 8480 case ISN_PUSHF:
8482 case ISN_PUSHNR: 8481 case ISN_PUSHNR:
8483 case ISN_PUSHSPEC: 8482 case ISN_PUSHSPEC:
8484 case ISN_PUT: 8483 case ISN_PUT:
8485 case ISN_RETURN: 8484 case ISN_RETURN:
8485 case ISN_RETURN_ZERO:
8486 case ISN_SHUFFLE: 8486 case ISN_SHUFFLE:
8487 case ISN_SLICE: 8487 case ISN_SLICE:
8488 case ISN_STORE: 8488 case ISN_STORE:
8489 case ISN_STOREINDEX: 8489 case ISN_STOREINDEX:
8490 case ISN_STORENR: 8490 case ISN_STORENR: