Add another const to tv_copy

Clang static analyzer had trouble with filter_map in eval.c because
tv_copy could, in principle, change the v_type of argvars[0]. It
saw a potential null pointer going somewhere it shouldn't as a result.

The from argument in tv_copy should be const, which also cleans up the
static analyzer's complaint.
This commit is contained in:
Paul Rigge
2017-12-30 22:17:31 -08:00
parent d63c3d9d10
commit dea7a41138

View File

@@ -2153,7 +2153,7 @@ void tv_free(typval_T *tv)
///
/// @param[in] from Location to copy from.
/// @param[out] to Location to copy to.
void tv_copy(typval_T *const from, typval_T *const to)
void tv_copy(const typval_T *const from, typval_T *const to)
{
to->v_type = from->v_type;
to->v_lock = VAR_UNLOCKED;