On 27-Apr-2021 04:33, Bram Moolenaar wrote:
Patch 8.2.2812
Problem:    Vim9: still crash when using substitute expression.
Solution:   Put the instruction list in the stack frame. (closes #8154)
Files:      src/vim9execute.c, src/vim9.h, src/testdir/test_vim9_cmd.vim


After this patch I noticed this warning from mingw64 (gcc 10.3.0):
<snip>
gcc -c -I. -Iproto -DWIN32 -DWINVER=0x0603 -D_WIN32_WINNT=0x0603 -DHAVE_PATHDEF -DFEAT_NORMAL -DHAVE_STDINT_H -D__USE_MINGW_ANSI_STDIO -pipe -march=native -Wall -O3 -fomit-frame-pointer -freg-struct-return -fpie -fPIE -DFEAT_GUI_MSWIN -DFEAT_CLIPBOARD vim9execute.c -o gobjnative/vim9execute.o
vim9execute.c: In function 'func_return':
vim9execute.c:546:14: warning: unused variable 'prev_dfunc' [-Wunused-variable]
  546 |     dfunc_T *prev_dfunc = ((dfunc_T *)def_functions.ga_data)
      |              ^~~~~~~~~~
</snip>

I think this warning came from patch 8.2.2530 which is where the relevant lines were added but it is weird that I hadn't noticed the warning before.

Anyway, the attached patch tries to fix it.

Cheers

--
--
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 on the web visit 
https://groups.google.com/d/msgid/vim_dev/bb780dc2-016d-491f-169b-aaba2add8cc8%40internode.on.net.
--- vim9execute.c.orig  2021-04-27 04:59:56.101619600 +1000
+++ vim9execute.c       2021-04-27 05:02:22.228856000 +1000
@@ -543,8 +543,10 @@
     estack_T   *entry;
     int                prev_dfunc_idx = STACK_TV(ectx->ec_frame_idx
                                        + STACK_FRAME_FUNC_OFF)->vval.v_number;
+#ifdef FEAT_PROFILE
     dfunc_T    *prev_dfunc = ((dfunc_T *)def_functions.ga_data)
                                                              + prev_dfunc_idx;
+#endif
     funclocal_T        *floc;
 
 #ifdef FEAT_PROFILE

Raspunde prin e-mail lui