diff src/vim9expr.c @ 30209:a970b48c25a3 v9.0.0440

patch 9.0.0440: crash when using mkdir() with "R" flag in compiled function Commit: https://github.com/vim/vim/commit/f5fec05c7fd0df4c934a838e82882e601dc920cb Author: Bram Moolenaar <Bram@vim.org> Date: Sun Sep 11 11:49:22 2022 +0100 patch 9.0.0440: crash when using mkdir() with "R" flag in compiled function Problem: Crash when using mkdir() with "R" flag in compiled function. Solution: Reserve a variable for deferred function calls. Handle more than one argument.
author Bram Moolenaar <Bram@vim.org>
date Sun, 11 Sep 2022 13:00:07 +0200
parents a542dfb1c1a2
children 61a688be1899
line wrap: on
line diff
--- a/src/vim9expr.c
+++ b/src/vim9expr.c
@@ -833,10 +833,11 @@ compile_call(
 		}
 	    }
 
-	    if (STRCMP(name, "writefile") == 0 && argcount > 2)
+	    if ((STRCMP(name, "writefile") == 0 && argcount > 2)
+		    || (STRCMP(name, "mkdir") == 0 && argcount > 1))
 	    {
-		// May have the "D" flag, reserve a variable for a deferred
-		// function call.
+		// May have the "D" or "R" flag, reserve a variable for a
+		// deferred function call.
 		if (get_defer_var_idx(cctx) == 0)
 		    idx = -1;
 	    }