1
0
forked from aniani/vim

patch 8.2.2390: Vim9: using positive offset is unexpected

Problem:    Vim9: using positive offset is unexpected.
Solution:   Use int8_T instead of char. (James McCoy)
This commit is contained in:
Bram Moolenaar
2021-01-22 17:51:06 +01:00
parent 9b6344613e
commit b3005ce191
4 changed files with 9 additions and 9 deletions

View File

@@ -826,10 +826,8 @@ generate_TYPECHECK(
if ((isn = generate_instr(cctx, ISN_CHECKTYPE)) == NULL)
return FAIL;
isn->isn_arg.type.ct_type = alloc_type(expected);
// 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;
isn->isn_arg.type.ct_off = (int8_T)offset;
isn->isn_arg.type.ct_arg_idx = (int8_T)argidx;
// type becomes expected
((type_T **)stack->ga_data)[stack->ga_len + offset] = expected;