fix(f_insert): partially port v8.2.0634

Fixes a crash in f_insert() when inserting into a NULL blob.
Include blob-related test changes and some other simple changes.
This commit is contained in:
Sean Dewar
2021-07-29 22:32:22 +01:00
parent 9b5c9dbfa7
commit 19232593ba
5 changed files with 21 additions and 0 deletions

View File

@@ -4984,6 +4984,10 @@ static void f_insert(typval_T *argvars, typval_T *rettv, FunPtr fptr)
bool error = false;
if (argvars[0].v_type == VAR_BLOB) {
if (argvars[0].vval.v_blob == NULL) {
return;
}
long before = 0;
const int len = tv_blob_len(argvars[0].vval.v_blob);