mirror of
https://github.com/neovim/neovim.git
synced 2026-02-08 21:08:47 +00:00
fix(api): parse_expression crash with ident and curly
Problem: nvim_parse_expression null pointer dereference when parsing an
identifier followed by { with "highlight" parameter set to false.
Solution: only set opening_hl_idx if pstate->colors is not NULL.
Not added to parser_tests.lua as that uses highlight = true.
This commit is contained in:
@@ -3238,9 +3238,11 @@ describe('API', function()
|
||||
end
|
||||
end
|
||||
|
||||
it('does not crash parsing invalid VimL expression #29648', function()
|
||||
it('does not crash parsing invalid VimL expression', function()
|
||||
api.nvim_input(':<C-r>=')
|
||||
api.nvim_input('1bork/')
|
||||
api.nvim_input('1bork/') -- #29648
|
||||
assert_alive()
|
||||
api.nvim_parse_expression('a{b}', '', false)
|
||||
assert_alive()
|
||||
end)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user