From 6a537c4659015d77f3daa5590568d9129fae7131 Mon Sep 17 00:00:00 2001 From: "Darryl L. Miles" Date: Thu, 13 Feb 2025 08:22:28 +0000 Subject: [PATCH] CodeQL IncorrectNotOperatorUsage.ql rtrDcmppose.c rtrCLEAR() usages Maybe it was a single bit and '!' operator inverted a single bit, but it appears to be a 4-bit mask today. TODO check rtrMARKED() this looks like it uses '&' operator is in use but from the context of a bitmask maybe this should be '|' operator. --- router/rtrDcmpose.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/router/rtrDcmpose.h b/router/rtrDcmpose.h index 40cda9ae..6a3b3f1d 100644 --- a/router/rtrDcmpose.h +++ b/router/rtrDcmpose.h @@ -53,6 +53,7 @@ /* rtrMARK(t,s) Tile * t; int s; * Mark the indicated horizontal tile edge as a valid channel boundary. + * FIXME this looks suspect, maybe it should be '|' operator and not '&'. */ #define rtrMARK(t,s) \ ((t)->ti_client = INT2CD((((int) CD2INT((t)->ti_client))&(s)))) @@ -61,7 +62,7 @@ * Clear the indicated horizontal tile edge as a valid channel boundary. */ #define rtrCLEAR(t,s) \ - ((t)->ti_client = INT2CD((((int) CD2INT((t)->ti_client))&(!s)))) + ((t)->ti_client = INT2CD((((int) CD2INT((t)->ti_client))&(~s)))) /* Private Procedures */ int rtrSrPaint();