diff options
Diffstat (limited to 'src/vim9execute.c')
-rw-r--r-- | src/vim9execute.c | 10 |
1 files changed, 6 insertions, 4 deletions
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; } |