diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2026-08-27 06:14:24 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-08-27 06:14:24 -0400 |
| commit | 02b0c80422bf8b0ae7a3e839d162bb5e28b81e65 (patch) | |
| tree | 38bffaeb9e36aaee6875f9c060db43352e88d1c8 /runtime/syntax/python.vim | |
| parent | 6eb36bcb2de9cb066e8169daed053c77eb7667ed (diff) | |
| download | rneovim-02b0c80422bf8b0ae7a3e839d162bb5e28b81e65.tar.gz rneovim-02b0c80422bf8b0ae7a3e839d162bb5e28b81e65.tar.bz2 rneovim-02b0c80422bf8b0ae7a3e839d162bb5e28b81e65.zip | |
fix(lua): blast radius of broken `_G.debug` #41507
Problem:
`nlua_pcall()` references `_G.debug.traceback`. If user code deletes it
or breaks it some other way, various Lua features are broken.
_G.debug = nil
vim.schedule(function() end)
vim.wait(100)
E5113: Lua chunk: attempt to index a nil value
stack traceback:
[C]: in function 'loop_poll'
[string "vim/_core/editor"]:176: in function 'wait'
crash.lua:3: in main chunk
PANIC: unprotected error in call to Lua API (attempt to index a nil value)
Solution:
Check `_G.debug.traceback` before using it as errfunc. If it's broken,
omit the traceback and say so in the error message.
Note: We could cache `_G.debug` in LUA_REGISTRYINDEX on startup, but
that would prevent plugins from providing custom functionality there
(and we happen to do so in `tui_spec.lua` for example).
Diffstat (limited to 'runtime/syntax/python.vim')
0 files changed, 0 insertions, 0 deletions