comparison src/vim9compile.c @ 26490:cd452f46085e v8.2.3775

patch 8.2.3775: Vim9: lambda compiled without outer context when debugging Commit: https://github.com/vim/vim/commit/9fffef9f3562e05755e4b3c46509b2eeeb623ff7 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Dec 10 16:55:58 2021 +0000 patch 8.2.3775: Vim9: lambda compiled without outer context when debugging Problem: Vim9: lambda compiled without outer context when debugging. Solution: When compiling a lambda for debugging also compile it without. (closes #9302)
author Bram Moolenaar <Bram@vim.org>
date Fri, 10 Dec 2021 18:00:05 +0100
parents ff0310e6f889
children b12d8a5af20e
comparison
equal deleted inserted replaced
26489:f19d8c077771 26490:cd452f46085e
3760 // compile_return(). 3760 // compile_return().
3761 if (ufunc->uf_ret_type->tt_type == VAR_VOID) 3761 if (ufunc->uf_ret_type->tt_type == VAR_VOID)
3762 ufunc->uf_ret_type = &t_unknown; 3762 ufunc->uf_ret_type = &t_unknown;
3763 compile_def_function(ufunc, FALSE, cctx->ctx_compile_type, cctx); 3763 compile_def_function(ufunc, FALSE, cctx->ctx_compile_type, cctx);
3764 3764
3765 // When the outer function is compiled for profiling or debugging, the
3766 // lambda may be called without profiling or debugging. Compile it here in
3767 // the right context.
3768 if (cctx->ctx_compile_type == CT_DEBUG
3765 #ifdef FEAT_PROFILE 3769 #ifdef FEAT_PROFILE
3766 // When the outer function is compiled for profiling, the lambda may be 3770 || cctx->ctx_compile_type == CT_PROFILE
3767 // called without profiling. Compile it here in the right context. 3771 #endif
3768 if (cctx->ctx_compile_type == CT_PROFILE) 3772 )
3769 compile_def_function(ufunc, FALSE, CT_NONE, cctx); 3773 compile_def_function(ufunc, FALSE, CT_NONE, cctx);
3770 #endif
3771 3774
3772 // The last entry in evalarg.eval_tofree_ga is a copy of the last line and 3775 // The last entry in evalarg.eval_tofree_ga is a copy of the last line and
3773 // "*arg" may point into it. Point into the original line to avoid a 3776 // "*arg" may point into it. Point into the original line to avoid a
3774 // dangling pointer. 3777 // dangling pointer.
3775 if (evalarg.eval_using_cmdline) 3778 if (evalarg.eval_using_cmdline)