comparison src/eval.c @ 31002:a09404dad917 v9.0.0836

patch 9.0.0836: wrong error when using extend() with funcref Commit: https://github.com/vim/vim/commit/91c75d18d9cdc32df57e648640de7476fbcb4d76 Author: zeertzjq <zeertzjq@outlook.com> Date: Sat Nov 5 20:21:58 2022 +0000 patch 9.0.0836: wrong error when using extend() with funcref Problem: Wrong error when using extend() with funcref. Solution: Better check the variable type. (closes https://github.com/vim/vim/issues/11468, closes https://github.com/vim/vim/issues/11455)
author Bram Moolenaar <Bram@vim.org>
date Sat, 05 Nov 2022 21:30:04 +0100
parents 360f286b5869
children a52697bcffa6
comparison
equal deleted inserted replaced
31001:9e10dfdb8747 31002:a09404dad917
1374 key[len] = NUL; 1374 key[len] = NUL;
1375 } 1375 }
1376 else 1376 else
1377 prevval = 0; // avoid compiler warning 1377 prevval = 0; // avoid compiler warning
1378 wrong = (lp->ll_dict->dv_scope == VAR_DEF_SCOPE 1378 wrong = (lp->ll_dict->dv_scope == VAR_DEF_SCOPE
1379 && rettv->v_type == VAR_FUNC 1379 && (rettv->v_type == VAR_FUNC
1380 || rettv->v_type == VAR_PARTIAL)
1380 && var_wrong_func_name(key, lp->ll_di == NULL)) 1381 && var_wrong_func_name(key, lp->ll_di == NULL))
1381 || !valid_varname(key, -1, TRUE); 1382 || !valid_varname(key, -1, TRUE);
1382 if (len != -1) 1383 if (len != -1)
1383 key[len] = prevval; 1384 key[len] = prevval;
1384 if (wrong) 1385 if (wrong)