r = eval_expr_typval(expr, argv, 2, rettv);
- clear_tv(&argv[0]);
+ if (argv[0].v_type != VAR_NUMBER && argv[0].v_type != VAR_UNKNOWN)
+ clear_tv(&argv[0]);
if (r == FAIL || called_emsg != called_emsg_start)
break;
+ // advance to the next item
if (range_list)
{
range_val += l->lv_u.nonmat.lv_stride;
return FAIL;
funcstack->fs_var_offset = argcount + STACK_FRAME_SIZE;
- funcstack->fs_ga.ga_len = funcstack->fs_var_offset + dfunc->df_varcount;
+ funcstack->fs_ga.ga_len = funcstack->fs_var_offset
+ + dfunc->df_varcount;
stack = ALLOC_CLEAR_MULT(typval_T, funcstack->fs_ga.ga_len);
funcstack->fs_ga.ga_data = stack;
if (stack == NULL)
failed_early:
// Free all arguments and local variables.
for (idx = 0; idx < ectx.ec_stack.ga_len; ++idx)
- clear_tv(STACK_TV(idx));
+ {
+ tv = STACK_TV(idx);
+ if (tv->v_type != VAR_NUMBER && tv->v_type != VAR_UNKNOWN)
+ clear_tv(tv);
+ }
ex_nesting_level = orig_nesting_level;
vim_free(ectx.ec_stack.ga_data);
break;
case ISN_NEWLIST:
smsg("%s%4d NEWLIST size %lld", pfx, current,
- (varnumber_T)(iptr->isn_arg.number));
+ (varnumber_T)(iptr->isn_arg.number));
break;
case ISN_NEWDICT:
smsg("%s%4d NEWDICT size %lld", pfx, current,
- (varnumber_T)(iptr->isn_arg.number));
+ (varnumber_T)(iptr->isn_arg.number));
break;
case ISN_NEWPARTIAL:
smsg("%s%4d NEWPARTIAL", pfx, current);