comparison src/vim9class.c @ 32142:64e8cd965e79 v9.0.1402

patch 9.0.1402: crash when using null_class Commit: https://github.com/vim/vim/commit/d13dd30240e32071210f55b587182ff48757ea46 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Mar 11 20:56:35 2023 +0000 patch 9.0.1402: crash when using null_class Problem: Crash when using null_class. Solution: Give an error when trying to use a null class.
author Bram Moolenaar <Bram@vim.org>
date Sat, 11 Mar 2023 22:00:03 +0100
parents fcc497515cce
children d542423ef5c9
comparison
equal deleted inserted replaced
32141:fb15a6785644 32142:64e8cd965e79
1260 return FAIL; 1260 return FAIL;
1261 } 1261 }
1262 cl = rettv->vval.v_object->obj_class; 1262 cl = rettv->vval.v_object->obj_class;
1263 } 1263 }
1264 1264
1265 if (cl == NULL)
1266 {
1267 emsg(_(e_incomplete_type));
1268 return FAIL;
1269 }
1270
1265 if (*name_end == '(') 1271 if (*name_end == '(')
1266 { 1272 {
1267 int on_class = rettv->v_type == VAR_CLASS; 1273 int on_class = rettv->v_type == VAR_CLASS;
1268 int count = on_class ? cl->class_class_function_count 1274 int count = on_class ? cl->class_class_function_count
1269 : cl->class_obj_method_count; 1275 : cl->class_obj_method_count;