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.
diff --git a/src/vim9expr.c b/src/vim9expr.c
index a8d88a2..3da556c 100644
--- a/src/vim9expr.c
+++ b/src/vim9expr.c
@@ -833,10 +833,11 @@
}
}
- 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;
}