mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.2.2378: Vim9: no error message for dividing by zero
Problem: Vim9: no error message for dividing by zero. Solution: Give an error message. (issue #7704)
This commit is contained in:
@@ -2954,10 +2954,16 @@ call_def_function(
|
||||
switch (iptr->isn_arg.op.op_type)
|
||||
{
|
||||
case EXPR_MULT: n1 = n1 * n2; break;
|
||||
case EXPR_DIV: n1 = num_divide(n1, n2); break;
|
||||
case EXPR_DIV: n1 = num_divide(n1, n2);
|
||||
if (n2 == 0)
|
||||
goto on_error;
|
||||
break;
|
||||
case EXPR_SUB: n1 = n1 - n2; break;
|
||||
case EXPR_ADD: n1 = n1 + n2; break;
|
||||
default: n1 = num_modulus(n1, n2); break;
|
||||
default: n1 = num_modulus(n1, n2);
|
||||
if (n2 == 0)
|
||||
goto on_error;
|
||||
break;
|
||||
}
|
||||
clear_tv(tv1);
|
||||
clear_tv(tv2);
|
||||
|
Reference in New Issue
Block a user