mirror of
https://github.com/github/codeql.git
synced 2026-04-29 10:45:15 +02:00
C/C++: Using UnspecifiedType instead of Type
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
|
||||
/**
|
||||
* @name Useless Test
|
||||
* @description A boolean condition that is guaranteed to never be evaluated should be deleted.
|
||||
@@ -39,8 +38,8 @@ where
|
||||
) and
|
||||
eq.getRightOperand() instanceof Literal and
|
||||
ne.getRightOperand() instanceof Literal and
|
||||
eq.getLeftOperand().getFullyConverted().getType() =
|
||||
ne.getLeftOperand().getFullyConverted().getType() and
|
||||
eq.getLeftOperand().getFullyConverted().getUnspecifiedType() =
|
||||
ne.getLeftOperand().getFullyConverted().getUnspecifiedType() and
|
||||
nearestParent(eq) = nearestParent(ne) and
|
||||
sameExpr(eq.getLeftOperand(), ne.getLeftOperand())
|
||||
select ne, "Useless Test"
|
||||
Reference in New Issue
Block a user