File tree Expand file tree Collapse file tree
cpp/ql/src/Likely Bugs/Format Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,15 +21,13 @@ import semmle.code.cpp.security.FlowSources
2121import semmle.code.cpp.ir.dataflow.internal.ModelUtil
2222import semmle.code.cpp.models.interfaces.DataFlow
2323import semmle.code.cpp.models.interfaces.Taint
24- import semmle.code.cpp.ir.implementation.raw.Instruction
24+ import semmle.code.cpp.ir.IR
2525
2626class UncalledFunction extends Function {
2727 UncalledFunction ( ) {
2828 not exists ( Call c | c .getTarget ( ) = this ) and
29- // TODO: Need rationale here, added based on suggestion
30- //but unclear of the scenario being avoided
31- not this .( MemberFunction ) .overrides ( _) and
3229 // Ignore functions that appear to be function pointers
30+ // function pointers may be seen as uncalled statically
3331 not exists ( FunctionAccess fa | fa .getTarget ( ) = this )
3432 }
3533}
@@ -39,7 +37,6 @@ class UncalledFunction extends Function {
3937 * Grabs the base type of the underlying type of `t` if `t` is a pointer and checks `isConst()` else
4038 * checks on the underlying type of `t` alone.
4139 */
42- bindingset [ t]
4340predicate hasConstSpecifier ( Type t ) {
4441 if t .getUnderlyingType ( ) instanceof PointerType
4542 then t .getUnderlyingType ( ) .( PointerType ) .getBaseType ( ) .isConst ( )
You can’t perform that action at this time.
0 commit comments