mirror of
https://github.com/neovim/neovim.git
synced 2026-02-08 21:08:47 +00:00
fix(api): parse_expression crash with unopened ] and node
Problem: nvim_parse_expression null pointer dereference with unmatched ] followed by a node. Solution: if ast_stack was empty, set new_top_node_p to top of the stack after pushing the list literal node; similar to what's done for curlies. This bug was originally found by a Matrix user, but I couldn't remember how to trigger it... Ran into the other crash while finding a repro. :P
This commit is contained in:
@@ -3242,6 +3242,8 @@ describe('API', function()
|
||||
api.nvim_input(':<C-r>=')
|
||||
api.nvim_input('1bork/') -- #29648
|
||||
assert_alive()
|
||||
api.nvim_input('<C-u>];')
|
||||
assert_alive()
|
||||
api.nvim_parse_expression('a{b}', '', false)
|
||||
assert_alive()
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user