On 19-Feb-2023 01:43, Bram Moolenaar wrote:
Patch 9.0.1320
Problem: Checking the type of a null object causes a crash.
Solution: Don't try to get the class of a null object. (closes #12005)
Handle error from calling a user function better.
Files: src/vim9type.c, src/vim.h, src/userfunc.c, src/proto/userfunc.pro,
src/evalfunc.c, src/proto/evalfunc.pro, src/vim9execute.c,
src/if_lua.c, src/testdir/test_vim9_class.vim
After this patch, msys64 (clang 15.0.7) gives this warning on gui and
non-gui builds:
<snip>
clang -c -I. -Iproto -DWIN32 -DWINVER=0x0603 -D_WIN32_WINNT=0x0603
-DHAVE_PATHDEF -DFEAT_NORMAL -DHAVE_STDINT_H -D__USE_MINGW_ANSI_STDIO
-pipe -Wall -O3 -fomit-frame-pointer -fpie -fPIE -DFEAT_GUI_MSWIN
-DFEAT_CLIPBOARD vim9expr.c -o gobjx86-64/vim9expr.o
vim9expr.c:993:57: warning: incompatible pointer types passing 'int *'
to parameter of type 'funcerror_T *' [-Wincompatible-pointer-types]
name = fname_trans_sid(namebuf, fname_buf, &tofree, &error);
^~~~~~
proto/userfunc.pro:12:88: note: passing argument to parameter 'error' here
char_u *fname_trans_sid(char_u *name, char_u *fname_buf, char_u
**tofree, funcerror_T *error);
^
1 warning generated.
</snip>
The attached patch tries to fix it.
Cheers
John
--
--
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/ef2654bb-6c9f-83bb-0b35-b22b4fde9383%40internode.on.net.
--- vim9expr.c.orig 2023-02-10 04:50:57.623550400 +1100
+++ vim9expr.c 2023-02-19 06:07:55.305866400 +1100
@@ -919,7 +919,7 @@
char_u namebuf[MAX_FUNC_NAME_LEN];
char_u fname_buf[FLEN_FIXED + 1];
char_u *tofree = NULL;
- int error = FCERR_NONE;
+ funcerror_T error = FCERR_NONE;
ufunc_T *ufunc = NULL;
int res = FAIL;
int is_autoload;