eval: recognize TOKEN_BRCCONST as integers

If TOKEN_BRCCONST are used in an expression (including simply wrapping
them in parentheses), then just treat them as integers.  This makes
things like ({dfv=cf}|{dfv=of}) work.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:
H. Peter Anvin 2024-07-27 18:19:35 -07:00
parent 6389ac8e47
commit bdfa9f952d

View file

@ -1,6 +1,6 @@
/* ----------------------------------------------------------------------- *
*
* Copyright 1996-2018 The NASM Authors - All Rights Reserved
* Copyright 1996-2024 The NASM Authors - All Rights Reserved
* See the file AUTHORS included with the NASM distribution for
* the specific copyright holders.
*
@ -918,6 +918,7 @@ static expr *expr6(void)
return e;
case TOKEN_NUM:
case TOKEN_BRCCONST:
case TOKEN_STR:
case TOKEN_REG:
case TOKEN_ID:
@ -928,6 +929,7 @@ static expr *expr6(void)
begintemp();
switch (tt) {
case TOKEN_NUM:
case TOKEN_BRCCONST:
addtotemp(EXPR_SIMPLE, tokval->t_integer);
break;
case TOKEN_STR: