From 630d0cef891a2692f3cc0d4aab474daee044be48 Mon Sep 17 00:00:00 2001 From: Sauyon Lee Date: Thu, 12 Mar 2020 09:13:15 -0700 Subject: [PATCH] Address review comments --- ql/src/InconsistentCode/MistypedExponentiation.ql | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ql/src/InconsistentCode/MistypedExponentiation.ql b/ql/src/InconsistentCode/MistypedExponentiation.ql index 3fefabc076a..ab9a5608369 100644 --- a/ql/src/InconsistentCode/MistypedExponentiation.ql +++ b/ql/src/InconsistentCode/MistypedExponentiation.ql @@ -34,8 +34,12 @@ where ) ) and // exclude the right hand side of assignments to variables that have "mask" in their name - not exists(Assignment assign | assign.getRhs() = xe.getParent*() | - assign.getLhs().getAChild*().(Ident).getName().regexpMatch(".*(^m|M)ask($|\\p{Lu}).*") + not exists(Assignment assign, Ident id | assign.getRhs() = xe.getParent*() | + id.getName().regexpMatch("(?i).*mask.*") and + ( + assign.getLhs() = id or + assign.getLhs().(SelectorExpr).getSelector() = id + ) ) select xe, "This expression uses the bitwise exclusive-or operator when exponentiation was likely meant."