Skip to content

Commit d4bc2ce

Browse files
committed
Minor efficiency improvements and comments.
1 parent 915aa94 commit d4bc2ce

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

cpp/ql/src/Likely Bugs/Format/NonConstantFormat.ql

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,13 @@ import semmle.code.cpp.security.FlowSources
2121
import semmle.code.cpp.ir.dataflow.internal.ModelUtil
2222
import semmle.code.cpp.models.interfaces.DataFlow
2323
import semmle.code.cpp.models.interfaces.Taint
24-
import semmle.code.cpp.ir.implementation.raw.Instruction
24+
import semmle.code.cpp.ir.IR
2525

2626
class 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]
4340
predicate hasConstSpecifier(Type t) {
4441
if t.getUnderlyingType() instanceof PointerType
4542
then t.getUnderlyingType().(PointerType).getBaseType().isConst()

0 commit comments

Comments
 (0)