comparison src/testdir/test_json.vim @ 21275:c14e628cd4bb v8.2.1188

patch 8.2.1188: memory leak with invalid json input Commit: https://github.com/vim/vim/commit/6d3a7213f58da834b0fc869d05f87e86010c66cf Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jul 12 14:34:00 2020 +0200 patch 8.2.1188: memory leak with invalid json input Problem: Memory leak with invalid json input. Solution: Free all keys at the end. (Dominique Pell?, closes https://github.com/vim/vim/issues/6443, closes #6442)
author Bram Moolenaar <Bram@vim.org>
date Sun, 12 Jul 2020 14:45:03 +0200
parents 6a4806e326dd
children 08940efa6b4e
comparison
equal deleted inserted replaced
21274:f7f5e51a629b 21275:c14e628cd4bb
199 call assert_fails('call json_decode("infinit")', "E491:") 199 call assert_fails('call json_decode("infinit")', "E491:")
200 200
201 call assert_fails('call json_decode("\"\\u111Z\"")', 'E491:') 201 call assert_fails('call json_decode("\"\\u111Z\"")', 'E491:')
202 call assert_equal('[😂]', json_decode('"[\uD83D\uDE02]"')) 202 call assert_equal('[😂]', json_decode('"[\uD83D\uDE02]"'))
203 call assert_equal('a😂b', json_decode('"a\uD83D\uDE02b"')) 203 call assert_equal('a😂b', json_decode('"a\uD83D\uDE02b"'))
204
205 call assert_fails('call json_decode("{\"\":{\"\":{")', 'E491:')
204 endfunc 206 endfunc
205 207
206 let s:jsl5 = '[7,,,]' 208 let s:jsl5 = '[7,,,]'
207 let s:varl5 = [7, v:none, v:none] 209 let s:varl5 = [7, v:none, v:none]
208 210