diff options
-rw-r--r-- | src/version.c | 2 | ||||
-rw-r--r-- | src/vim9execute.c | 10 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/version.c b/src/version.c index c220a409ec..2b6f6a88e3 100644 --- a/src/version.c +++ b/src/version.c @@ -751,6 +751,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 2382, +/**/ 2381, /**/ 2380, diff --git a/src/vim9execute.c b/src/vim9execute.c index b1bc282636..59a0982b3f 100644 --- a/src/vim9execute.c +++ b/src/vim9execute.c @@ -2951,17 +2951,19 @@ call_def_function( else #endif { + int failed = FALSE; + switch (iptr->isn_arg.op.op_type) { case EXPR_MULT: n1 = n1 * n2; break; - case EXPR_DIV: n1 = num_divide(n1, n2); - if (n2 == 0) + case EXPR_DIV: n1 = num_divide(n1, n2, &failed); + if (failed) goto on_error; break; case EXPR_SUB: n1 = n1 - n2; break; case EXPR_ADD: n1 = n1 + n2; break; - default: n1 = num_modulus(n1, n2); - if (n2 == 0) + default: n1 = num_modulus(n1, n2, &failed); + if (failed) goto on_error; break; } |