summaryrefslogtreecommitdiff
path: root/assemble.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2013-11-08 15:28:19 -0800
committerH. Peter Anvin <hpa@linux.intel.com>2013-11-08 15:28:19 -0800
commitc6c750cb3ddd094fa8195cdcd6d5c8c1d1d02d60 (patch)
tree8468f48b2abc85cdcff9c74066e0f0451f575f42 /assemble.c
parent1be09ee0d72b692b4c0ca40dbc3878f5bfc9b1da (diff)
downloadnasm-c6c750cb3ddd094fa8195cdcd6d5c8c1d1d02d60.tar.gz
nasm-c6c750cb3ddd094fa8195cdcd6d5c8c1d1d02d60.tar.bz2
nasm-c6c750cb3ddd094fa8195cdcd6d5c8c1d1d02d60.zip
Add (redundant) parentheses around bit tests mixed with &&
It is easy to get confused when mixing & and &&, so add redundant parenteses for clarity. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'assemble.c')
-rw-r--r--assemble.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/assemble.c b/assemble.c
index 63f684a..57ef0cd 100644
--- a/assemble.c
+++ b/assemble.c
@@ -1872,7 +1872,7 @@ static int rexflags(int val, opflags_t flags, int mask)
{
int rex = 0;
- if (val >= 0 && val & 8)
+ if (val >= 0 && (val & 8))
rex |= REX_B|REX_X|REX_R;
if (flags & BITS64)
rex |= REX_W;
@@ -1891,11 +1891,11 @@ static int evexflags(int val, decoflags_t deco,
switch (byte) {
case 0:
- if (val >= 0 && val & 16)
+ if (val >= 0 && (val & 16))
evex |= (EVEX_P0RP | EVEX_P0X);
break;
case 2:
- if (val >= 0 && val & 16)
+ if (val >= 0 && (val & 16))
evex |= EVEX_P2VP;
if (deco & Z)
evex |= EVEX_P2Z;