mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-04-12 18:40:23 +08:00
Allow '!' to be used in expressions with same meaning as in C.
This commit is contained in:
parent
60ae75d3ab
commit
cb9bc21374
13
eval.c
13
eval.c
@ -631,6 +631,19 @@ static expr *expr6(int critical)
|
||||
return NULL;
|
||||
}
|
||||
return scalarvect(~reloc_value(e));
|
||||
} else if (i == '!') {
|
||||
i = scan(scpriv, tokval);
|
||||
e = expr6(critical);
|
||||
if (!e)
|
||||
return NULL;
|
||||
if (is_just_unknown(e))
|
||||
return unknown_expr();
|
||||
else if (!is_simple(e)) {
|
||||
error(ERR_NONFATAL, "`!' operator may only be applied to"
|
||||
" scalar values");
|
||||
return NULL;
|
||||
}
|
||||
return scalarvect(!reloc_value(e));
|
||||
} else if (i == TOKEN_SEG) {
|
||||
i = scan(scpriv, tokval);
|
||||
e = expr6(critical);
|
||||
|
Loading…
x
Reference in New Issue
Block a user