Mercurial > vim
comparison src/testdir/test_blob.vim @ 19930:80e663e91e1b v8.2.0521
patch 8.2.0521: crash when reading a blob fails
Commit: https://github.com/vim/vim/commit/15352dc6ec43fd50cc3be4f4fd1ad74d5619da20
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Apr 6 21:12:42 2020 +0200
patch 8.2.0521: crash when reading a blob fails
Problem: Crash when reading a blob fails.
Solution: Avoid keeping a pointer to a freed blob object. (Dominique Pelle,
closes #5890) Adjust error messages.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 06 Apr 2020 21:15:37 +0200 |
parents | 546bdeef35f1 |
children | e82996ad131f |
comparison
equal
deleted
inserted
replaced
19929:35310c0dd026 | 19930:80e663e91e1b |
---|---|
255 let b = 0zDEADBEEF | 255 let b = 0zDEADBEEF |
256 call writefile(b, 'Xblob') | 256 call writefile(b, 'Xblob') |
257 let br = readfile('Xblob', 'B') | 257 let br = readfile('Xblob', 'B') |
258 call assert_equal(b, br) | 258 call assert_equal(b, br) |
259 call delete('Xblob') | 259 call delete('Xblob') |
260 | |
261 " This was crashing when calling readfile() with a directory. | |
262 call assert_fails("call readfile('.', 'B')", 'E17: "." is a directory') | |
260 endfunc | 263 endfunc |
261 | 264 |
262 " filter() item in blob | 265 " filter() item in blob |
263 func Test_blob_filter() | 266 func Test_blob_filter() |
264 call assert_equal(0z, filter(0zDEADBEEF, '0')) | 267 call assert_equal(0z, filter(0zDEADBEEF, '0')) |