Check and enforce range limit on the [w] modifier in expressions.

This commit is contained in:
waltje
2023-04-25 16:56:14 -04:00
parent 332842741e
commit 128daccc22

View File

@@ -602,6 +602,8 @@ expr(char **p)
/* Lossless conversion to word. */
*p += 3;
v = compare(p);
if (DEFINED(v) && v.v > 0xffff)
error(ERR_RNG_WORD, NULL);
SET_TYPE(v, TYPE_WORD);
} else {
/* Iterate. */