mirror of
https://github.com/neovim/neovim.git
synced 2025-10-05 09:26:30 +00:00
userfunc: abort early on invalid refs
Cherry-pick set_ref_in_call_stack() changes from patch 8.1.1575.
This commit is contained in:
@@ -3413,12 +3413,13 @@ bool set_ref_in_call_stack(int copyID)
|
||||
{
|
||||
bool abort = false;
|
||||
|
||||
for (funccall_T *fc = current_funccal; fc != NULL; fc = fc->caller) {
|
||||
for (funccall_T *fc = current_funccal; !abort && fc != NULL;
|
||||
fc = fc->caller) {
|
||||
abort = abort || set_ref_in_funccal(fc, copyID);
|
||||
}
|
||||
|
||||
// Also go through the funccal_stack.
|
||||
for (funccal_entry_T *entry = funccal_stack; entry != NULL;
|
||||
for (funccal_entry_T *entry = funccal_stack; !abort && entry != NULL;
|
||||
entry = entry->next) {
|
||||
for (funccall_T *fc = entry->top_funccal; !abort && fc != NULL;
|
||||
fc = fc->caller) {
|
||||
|
Reference in New Issue
Block a user