Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1b9a2d3

Browse files
pavgustjbj
authored andcommitted
Reduce partial definition flow edge redundancy
1 parent bb8eb23 commit 1b9a2d3

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

cpp/ql/src/semmle/code/cpp/dataflow/internal/DataFlowPrivate.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ private class ArrayContent extends Content, TArrayContent {
173173
predicate storeStep(Node node1, Content f, PostUpdateNode node2) {
174174
exists(FieldAccess fa |
175175
exists(Assignment a |
176-
(a.getRValue() = node1.asExpr() or node1.asExpr() = a) and
176+
node1.asExpr() = a and
177177
a.getLValue() = fa
178178
) and
179179
not fa.getTarget().isStatic() and

cpp/ql/src/semmle/code/cpp/dataflow/internal/FlowVar.qll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,8 @@ module FlowVar_internal {
320320
BlockVar() { this = TBlockVar(sbb, v) }
321321

322322
override VariableAccess getAnAccess() {
323-
variableAccessInSBB(v, getAReachedBlockVarSBB(this), result)
323+
variableAccessInSBB(v, getAReachedBlockVarSBB(this), result) and
324+
result != sbb
324325
}
325326

326327
override predicate definedByInitialValue(LocalScopeVariable lsv) {

0 commit comments

Comments
 (0)