comparison src/vim9compile.c @ 23923:be36288235af v8.2.2504

patch 8.2.2504: Vim9: crash when using an argument from a closure Commit: https://github.com/vim/vim/commit/44ec21c467ddf481b422c787324ea08f375f6942 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Feb 12 21:50:57 2021 +0100 patch 8.2.2504: Vim9: crash when using an argument from a closure Problem: Vim9: crash when using an argument from a closure. Solution: Check if gen_load_outer is NULL. (closes https://github.com/vim/vim/issues/7821)
author Bram Moolenaar <Bram@vim.org>
date Fri, 12 Feb 2021 22:00:04 +0100
parents 4b417b776b95
children 5e5780e3f75d
comparison
equal deleted inserted replaced
23922:dba960dacd31 23923:be36288235af
259 { 259 {
260 // Lookup the name for an argument of the outer function. 260 // Lookup the name for an argument of the outer function.
261 if (arg_exists(name, len, idxp, type, gen_load_outer, cctx->ctx_outer) 261 if (arg_exists(name, len, idxp, type, gen_load_outer, cctx->ctx_outer)
262 == OK) 262 == OK)
263 { 263 {
264 ++*gen_load_outer; 264 if (gen_load_outer != NULL)
265 ++*gen_load_outer;
265 return OK; 266 return OK;
266 } 267 }
267 } 268 }
268 269
269 return FAIL; 270 return FAIL;