Patch 8.2.1207
Problem:    Vim9: crash in expr test when run in the GUI.
Solution:   Break out of loop over hashtab also when function got removed and
            added.
Files:      src/userfunc.c, src/testdir/test_vim9_expr.vim


*** ../vim-8.2.1206/src/userfunc.c      2020-07-12 17:07:01.024810908 +0200
--- src/userfunc.c      2020-07-14 14:59:30.884919495 +0200
***************
*** 3444,3451 ****
      void
  ex_defcompile(exarg_T *eap UNUSED)
  {
!     long_u    ht_used = func_hashtab.ht_used;
!     int               todo = (int)ht_used;
      hashitem_T        *hi;
      ufunc_T   *ufunc;
  
--- 3444,3451 ----
      void
  ex_defcompile(exarg_T *eap UNUSED)
  {
!     long      todo = (long)func_hashtab.ht_used;
!     int               changed = func_hashtab.ht_changed;
      hashitem_T        *hi;
      ufunc_T   *ufunc;
  
***************
*** 3460,3471 ****
            {
                compile_def_function(ufunc, FALSE, NULL);
  
!               if (func_hashtab.ht_used != ht_used)
                {
!                   // another function has been defined, need to start over
                    hi = func_hashtab.ht_array;
-                   ht_used = func_hashtab.ht_used;
-                   todo = (int)ht_used;
                    --hi;
                }
            }
--- 3460,3471 ----
            {
                compile_def_function(ufunc, FALSE, NULL);
  
!               if (func_hashtab.ht_changed != changed)
                {
!                   // a function has been added or removed, need to start over
!                   todo = (long)func_hashtab.ht_used;
!                   changed = func_hashtab.ht_changed;
                    hi = func_hashtab.ht_array;
                    --hi;
                }
            }
*** ../vim-8.2.1206/src/testdir/test_vim9_expr.vim      2020-07-13 
23:22:50.080524726 +0200
--- src/testdir/test_vim9_expr.vim      2020-07-13 23:52:16.655335033 +0200
***************
*** 1563,1572 ****
  enddef
  
  func Test_expr7_trailing_fails()
!   " Temporarily commented out - somehow crash occurs with too many
!   " CheckDefFailure calls in the GUI only.
!   " call CheckDefFailure(['let l = [2]', 'l->{l -> add(l, 8)}'], 'E107')
!   " call CheckDefFailure(['let l = [2]', 'l->{l -> add(l, 8)} ()'], 'E274')
  endfunc
  
  func Test_expr_fails()
--- 1563,1570 ----
  enddef
  
  func Test_expr7_trailing_fails()
!   call CheckDefFailure(['let l = [2]', 'l->{l -> add(l, 8)}'], 'E107')
!   call CheckDefFailure(['let l = [2]', 'l->{l -> add(l, 8)} ()'], 'E274')
  endfunc
  
  func Test_expr_fails()
*** ../vim-8.2.1206/src/version.c       2020-07-13 23:22:50.080524726 +0200
--- src/version.c       2020-07-14 15:00:17.012787017 +0200
***************
*** 756,757 ****
--- 756,759 ----
  {   /* Add new patch number below this line */
+ /**/
+     1207,
  /**/

-- 
Far out in the uncharted backwaters of the unfashionable end of the
Western Spiral arm of the Galaxy lies a small unregarded yellow sun.
Orbiting this at a distance of roughly ninety-eight million miles is an
utterly insignificant little blue-green planet whose ape-descended life
forms are so amazingly primitive that they still think digital watches
are a pretty neat idea ...
                -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy"

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/202007141301.06ED1qEE3044799%40masaka.moolenaar.net.

Raspunde prin e-mail lui