1
0
forked from aniani/vim

patch 8.2.2389: test failure on a few systems

Problem:    Test failure on a few systems.
Solution:   Avoid that "char" value is negative.
This commit is contained in:
Bram Moolenaar
2021-01-21 22:53:38 +01:00
parent 57d5a01cb4
commit 9b6344613e
4 changed files with 9 additions and 5 deletions

View File

@@ -826,7 +826,9 @@ generate_TYPECHECK(
if ((isn = generate_instr(cctx, ISN_CHECKTYPE)) == NULL)
return FAIL;
isn->isn_arg.type.ct_type = alloc_type(expected);
isn->isn_arg.type.ct_off = offset;
// Use the negated offset so that it's always positive. Some systems don't
// support negative numbers for "char".
isn->isn_arg.type.ct_off = (char)-offset;
isn->isn_arg.type.ct_arg_idx = argidx;
// type becomes expected