Re: [vim/vim] vim9: SIGSEGV storing to a loop variable from a closure — generate_STOREOUTER() encodes loop depth with a sentinel the executor decodes as an array index (Issue #20877)

"Niklas E. O. Harju" (Vim Github Repository) <[email protected]> Wed, 29 Jul 2026 23:37:10 -0700
Newsgroups gmane.editors.vim.devel
Message-ID <vim/vim/issues/20877/[email protected]>
neoharju left a comment (vim/vim#20877)

It looks to be the same, you added tests, but you deleted the executor bounds guard (checks loop_idx against out_loop_size and .stack != NULL before dereferencing — so a future encoding bug reports an internal error instead of crashing.) and a UB fix upstream inherited; list_instructions prints -outer->outer_depth, which is signed overflow for INT_MIN (C11 6.5p5). Debug-path only, and upstream's version has it verbatim. Ours negates in unsigned arithmetic.

Anyway, this PR will fix my plugin functioning regardless, and I will not have to manually patch it.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/vim/vim/issues/20877#issuecomment-5127486729
You are receiving this because you are subscribed to this thread.

Message ID: <vim/vim/issues/20877/[email protected]>

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/vim_dev/vim/vim/issues/20877/5127486729%40github.com.