comparison src/vim9class.c @ 33291:4cb421ba3385 v9.0.1911

patch 9.0.1911: Vim9: segfault with null object and instanceof() Commit: https://github.com/vim/vim/commit/3da696db6ac6103eb8f07cf7be23fa0e12c2419d Author: Ernie Rael <errael@raelity.com> Date: Tue Sep 19 20:14:18 2023 +0200 patch 9.0.1911: Vim9: segfault with null object and instanceof() Problem: Vim9: segfault with null object and instanceof() Solution: return early closes: #13121 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: Ernie Rael <errael@raelity.com>
author Christian Brabandt <cb@256bit.org>
date Tue, 19 Sep 2023 20:30:07 +0200
parents 0c3553cfe22e
children 6340c608ca54
comparison
equal deleted inserted replaced
33290:9a7b1f8aea55 33291:4cb421ba3385
2863 2863
2864 if (check_for_object_arg(argvars, 0) == FAIL 2864 if (check_for_object_arg(argvars, 0) == FAIL
2865 || check_for_class_or_list_arg(argvars, 1) == FAIL) 2865 || check_for_class_or_list_arg(argvars, 1) == FAIL)
2866 return; 2866 return;
2867 2867
2868 if (object_tv->vval.v_object == NULL)
2869 return;
2870
2868 if (classinfo_tv->v_type == VAR_LIST) 2871 if (classinfo_tv->v_type == VAR_LIST)
2869 { 2872 {
2870 FOR_ALL_LIST_ITEMS(classinfo_tv->vval.v_list, li) 2873 FOR_ALL_LIST_ITEMS(classinfo_tv->vval.v_list, li)
2871 { 2874 {
2872 if (li->li_tv.v_type != VAR_CLASS) 2875 if (li->li_tv.v_type != VAR_CLASS)