0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.2.1560: using NULL pointers in some code

Problem:    Using NULL pointers in some code. (James McCoy)
Solution:   Avoid adding to a NULL pointer.  Use byte as unsigned.
This commit is contained in:
Bram Moolenaar
2020-09-01 19:56:15 +02:00
parent ca563b9b94
commit 9c2b06637b
6 changed files with 26 additions and 14 deletions

View File

@@ -1147,7 +1147,10 @@ generate_NEWLIST(cctx_T *cctx, int count)
isn->isn_arg.number = count;
// get the member type from all the items on the stack.
member = get_member_type_from_stack(
if (count == 0)
member = &t_void;
else
member = get_member_type_from_stack(
((type_T **)stack->ga_data) + stack->ga_len, count, 1,
cctx->ctx_type_list);
type = get_list_type(member, cctx->ctx_type_list);
@@ -1180,7 +1183,10 @@ generate_NEWDICT(cctx_T *cctx, int count)
return FAIL;
isn->isn_arg.number = count;
member = get_member_type_from_stack(
if (count == 0)
member = &t_void;
else
member = get_member_type_from_stack(
((type_T **)stack->ga_data) + stack->ga_len, count, 2,
cctx->ctx_type_list);
type = get_dict_type(member, cctx->ctx_type_list);