Hi Bram,

On Sun, Feb 20, 2022 at 8:48 AM Bram Moolenaar <[email protected]> wrote:
>
> Yegappan wrote:
>
> > > > The Vim9 LSP plugin (https://github.com/yegappan/lsp) has the
> > > > following line in the autoload/lsp/lspserver.vim file:
> > > >
> > > > hover: function(Hover, [lspserver]),
> > > >
> > > > If this line is changed to:
> > > >
> > > > hover: function('Hover', [lspserver]),
> > > >
> > > > then Vim crashes with the "E342: Out of memory!  (allocating
> > > > 18446744073709551608 bytes)" error.
> > > >
>
> What is the smallest script to reproduce this problem?
> The quoted line is missing context.
>

I am able to reproduce this crash with the following two minimal scripts.

------------------------ x.vim ------------------------------
vim9script

import './y.vim' as server

export def Hover()
enddef

def AddServer()
  var d: dict<any> = server.NewLspServer()
enddef
AddServer()
---------------------------------------------------------------

------------------------ y.vim ------------------------------
vim9script

def Hover(d: dict<any>): void
enddef

export def NewLspServer(): dict<any>
  var d: dict<any> = {}
  d->extend({hover: function('Hover', [d])})
  return d
enddef

NewLspServer()
---------------------------------------------------------------

With the above two x.vim and y.vim scripts, if you source x.vim,
then Vim crashes.

Regards,
Yegappan

-- 
-- 
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/CAAW7x7nKzNpXJ3bcFH9WZuoS0wiM15VBpobH%3DjH774oFP8uEWA%40mail.gmail.com.

Raspunde prin e-mail lui