Skip to content

Commit 9967102

Browse files
committed
CodeQL: Fix _ATOM handling in non-term-to-term-func
Now _ATOM constants are implemented using enums, so make sure that they are not reported as invalid since they are safe by design. Signed-off-by: Davide Bettio <davide@uninstall.it>
1 parent 55394d9 commit 9967102

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

code-queries/non-term-to-term-func.ql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ predicate isNotTermOrAtom(Expr expr) {
3434
(mi.toString().matches("%_ATOM") or mi.toString().matches("TERM_%"))
3535
)
3636
) and
37+
not (
38+
expr instanceof EnumConstantAccess and
39+
expr.(EnumConstantAccess).getTarget().toString().matches("%_ATOM")
40+
) and
3741
(
3842
not expr instanceof ConditionalExpr
3943
or

0 commit comments

Comments
 (0)