diff src/regexp.c @ 28692:bfd8e25fa207 v8.2.4870

patch 8.2.4870: Vim9: expression in :substitute is not compiled Commit: https://github.com/vim/vim/commit/f3b4895f2727e3849ca10030b251cccd9d1383f3 Author: LemonBoy <thatlemon@gmail.com> Date: Thu May 5 13:53:03 2022 +0100 patch 8.2.4870: Vim9: expression in :substitute is not compiled Problem: Vim9: expression in :substitute is not compiled. Solution: Use an INSTR instruction if possible. (closes https://github.com/vim/vim/issues/10334)
author Bram Moolenaar <Bram@vim.org>
date Thu, 05 May 2022 15:00:04 +0200
parents 3c7f1b3ae427
children c98fc7a4dde4
line wrap: on
line diff
--- a/src/regexp.c
+++ b/src/regexp.c
@@ -2004,6 +2004,10 @@ vim_regsub_both(
 		    funcexe.fe_partial = partial;
 		    call_func(s, -1, &rettv, 1, argv, &funcexe);
 		}
+		else if (expr->v_type == VAR_INSTR)
+		{
+		    exe_typval_instr(expr, &rettv);
+		}
 		if (matchList.sl_list.lv_len > 0)
 		    // fill_submatch_list() was called
 		    clear_submatch_list(&matchList);