Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e048207 commit eed24f1Copy full SHA for eed24f1
1 file changed
cpp/ql/src/semmle/code/cpp/dataflow/internal/FlowVar.qll
@@ -490,7 +490,7 @@ module FlowVar_internal {
490
exists(VariableAccess va |
491
va.getTarget() = result and
492
readAccess(va) and
493
- bbNotInLoop(va.getBasicBlock())
+ exists(BasicBlock bb | bb = va.getBasicBlock() | not this.bbInLoop(bb))
494
)
495
}
496
@@ -679,10 +679,11 @@ module FlowVar_internal {
679
predicate dominatedByOverwrite(UninitializedLocalVariable v, VariableAccess va) {
680
exists(BasicBlock bb, int vaIndex |
681
va = bb.getNode(vaIndex) and
682
- va.getTarget() = v
683
- |
+ va.getTarget() = v and
684
vaIndex > indexOfFirstOverwriteInBB(v, bb)
685
or
+ va = bb.getNode(vaIndex) and
686
687
bbStrictlyDominates(getAnOverwritingBB(v), bb)
688
689
0 commit comments