Mercurial > vim
comparison src/testdir/test_vim9_expr.vim @ 23669:cf2904dd9691 v8.2.2376
patch 8.2.2376: Vim9: crash when dividing by zero in compiled code
Commit: https://github.com/vim/vim/commit/e64f83cc6aba05baa61ba4a4cb8d4447b8091e5b
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Jan 19 22:16:41 2021 +0100
patch 8.2.2376: Vim9: crash when dividing by zero in compiled code
Problem: Vim9: crash when dividing by zero in compiled code using
constants.
Solution: Call num_divide() and num_modulus(). (closes #7704)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 19 Jan 2021 22:30:08 +0100 |
parents | 455ad460ff4f |
children | 6d35bc0f161e |
comparison
equal
deleted
inserted
replaced
23668:4e893aa1380c | 23669:cf2904dd9691 |
---|---|
1374 assert_equal(6, 60 / | 1374 assert_equal(6, 60 / |
1375 g:anint) | 1375 g:anint) |
1376 assert_equal(1, g:anint / 6) | 1376 assert_equal(1, g:anint / 6) |
1377 assert_equal(2, g:anint | 1377 assert_equal(2, g:anint |
1378 / g:thefour) | 1378 / g:thefour) |
1379 assert_true(1 / 0 > 99999) | |
1379 | 1380 |
1380 assert_equal(5, 11 % 6) | 1381 assert_equal(5, 11 % 6) |
1381 assert_equal(4, g:anint % 6) | 1382 assert_equal(4, g:anint % 6) |
1382 assert_equal(3, 13 % | 1383 assert_equal(3, 13 % |
1383 g:anint) | 1384 g:anint) |
1384 assert_equal(2, g:anint | 1385 assert_equal(2, g:anint |
1385 % g:thefour) | 1386 % g:thefour) |
1387 assert_equal(0, 1 % 0) | |
1386 | 1388 |
1387 assert_equal(4, 6 * 4 / 6) | 1389 assert_equal(4, 6 * 4 / 6) |
1388 | 1390 |
1389 var x = [2] | 1391 var x = [2] |
1390 var y = [3] | 1392 var y = [3] |