aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/ops.c3
-rw-r--r--src/nvim/testdir/test_put.vim7
2 files changed, 2 insertions, 8 deletions
diff --git a/src/nvim/ops.c b/src/nvim/ops.c
index e6e617a419..2218b079b0 100644
--- a/src/nvim/ops.c
+++ b/src/nvim/ops.c
@@ -3434,7 +3434,8 @@ void do_put(int regname, yankreg_T *reg, int dir, long count, int flags)
const long multlen = count * yanklen;
totlen = (size_t)(int)multlen;
- if (totlen != (size_t)multlen) {
+ if (totlen != (size_t)multlen || (long)totlen / count != yanklen
+ || (long)totlen / yanklen != count) {
emsg(_(e_resulting_text_too_long));
break;
} else if (totlen > 0) {
diff --git a/src/nvim/testdir/test_put.vim b/src/nvim/testdir/test_put.vim
index a159687a76..bf222477a2 100644
--- a/src/nvim/testdir/test_put.vim
+++ b/src/nvim/testdir/test_put.vim
@@ -139,13 +139,6 @@ func Test_p_with_count_leaves_mark_at_end()
endfunc
func Test_very_large_count()
- " FIXME: should actually check if sizeof(int) == sizeof(long)
- CheckNotMSWindows
-
- if v:numbersize != 64
- throw 'Skipped: only works with 64 bit numbers'
- endif
-
new
let @" = 'x'
call assert_fails('norm 44444444444444p', 'E1240:')