diff 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
line wrap: on
line diff
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -261,7 +261,8 @@ arg_exists(
 	if (arg_exists(name, len, idxp, type, gen_load_outer, cctx->ctx_outer)
 									 == OK)
 	{
-	    ++*gen_load_outer;
+	    if (gen_load_outer != NULL)
+		++*gen_load_outer;
 	    return OK;
 	}
     }