diff options
Diffstat (limited to 'src/vim9compile.c')
-rw-r--r-- | src/vim9compile.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/vim9compile.c b/src/vim9compile.c index ead971feba..2fad4ac34b 100644 --- a/src/vim9compile.c +++ b/src/vim9compile.c @@ -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 |