Skip to content

Commit 0bd587b

Browse files
committed
Shared SSA: Sync files
1 parent e185e90 commit 0bd587b

File tree

5 files changed

+20
-15
lines changed

5 files changed

+20
-15
lines changed

cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/SsaImplCommon.qll

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -645,17 +645,18 @@ module Consistency {
645645

646646
query predicate nonUniqueDef(RelevantDefinition def, SourceVariable v, BasicBlock bb, int i) {
647647
ssaDefReachesRead(v, def, bb, i) and
648-
not exists(unique(Definition def0 | ssaDefReachesRead(_, def0, bb, i)))
648+
not exists(unique(Definition def0 | ssaDefReachesRead(v, def0, bb, i)))
649649
}
650650

651651
query predicate readWithoutDef(SourceVariable v, BasicBlock bb, int i) {
652652
variableRead(bb, i, v, _) and
653-
not ssaDefReachesRead(_, _, bb, i)
653+
not ssaDefReachesRead(v, _, bb, i)
654654
}
655655

656656
query predicate deadDef(RelevantDefinition def, SourceVariable v) {
657657
v = def.getSourceVariable() and
658658
not ssaDefReachesRead(_, def, _, _) and
659-
not phiHasInputFromBlock(_, def, _)
659+
not phiHasInputFromBlock(_, def, _) and
660+
not uncertainWriteDefinitionInput(_, def)
660661
}
661662
}

csharp/ql/lib/semmle/code/cil/internal/SsaImplCommon.qll

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -645,17 +645,18 @@ module Consistency {
645645

646646
query predicate nonUniqueDef(RelevantDefinition def, SourceVariable v, BasicBlock bb, int i) {
647647
ssaDefReachesRead(v, def, bb, i) and
648-
not exists(unique(Definition def0 | ssaDefReachesRead(_, def0, bb, i)))
648+
not exists(unique(Definition def0 | ssaDefReachesRead(v, def0, bb, i)))
649649
}
650650

651651
query predicate readWithoutDef(SourceVariable v, BasicBlock bb, int i) {
652652
variableRead(bb, i, v, _) and
653-
not ssaDefReachesRead(_, _, bb, i)
653+
not ssaDefReachesRead(v, _, bb, i)
654654
}
655655

656656
query predicate deadDef(RelevantDefinition def, SourceVariable v) {
657657
v = def.getSourceVariable() and
658658
not ssaDefReachesRead(_, def, _, _) and
659-
not phiHasInputFromBlock(_, def, _)
659+
not phiHasInputFromBlock(_, def, _) and
660+
not uncertainWriteDefinitionInput(_, def)
660661
}
661662
}

csharp/ql/lib/semmle/code/csharp/controlflow/internal/pressa/SsaImplCommon.qll

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -645,17 +645,18 @@ module Consistency {
645645

646646
query predicate nonUniqueDef(RelevantDefinition def, SourceVariable v, BasicBlock bb, int i) {
647647
ssaDefReachesRead(v, def, bb, i) and
648-
not exists(unique(Definition def0 | ssaDefReachesRead(_, def0, bb, i)))
648+
not exists(unique(Definition def0 | ssaDefReachesRead(v, def0, bb, i)))
649649
}
650650

651651
query predicate readWithoutDef(SourceVariable v, BasicBlock bb, int i) {
652652
variableRead(bb, i, v, _) and
653-
not ssaDefReachesRead(_, _, bb, i)
653+
not ssaDefReachesRead(v, _, bb, i)
654654
}
655655

656656
query predicate deadDef(RelevantDefinition def, SourceVariable v) {
657657
v = def.getSourceVariable() and
658658
not ssaDefReachesRead(_, def, _, _) and
659-
not phiHasInputFromBlock(_, def, _)
659+
not phiHasInputFromBlock(_, def, _) and
660+
not uncertainWriteDefinitionInput(_, def)
660661
}
661662
}

csharp/ql/lib/semmle/code/csharp/dataflow/internal/SsaImplCommon.qll

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -645,17 +645,18 @@ module Consistency {
645645

646646
query predicate nonUniqueDef(RelevantDefinition def, SourceVariable v, BasicBlock bb, int i) {
647647
ssaDefReachesRead(v, def, bb, i) and
648-
not exists(unique(Definition def0 | ssaDefReachesRead(_, def0, bb, i)))
648+
not exists(unique(Definition def0 | ssaDefReachesRead(v, def0, bb, i)))
649649
}
650650

651651
query predicate readWithoutDef(SourceVariable v, BasicBlock bb, int i) {
652652
variableRead(bb, i, v, _) and
653-
not ssaDefReachesRead(_, _, bb, i)
653+
not ssaDefReachesRead(v, _, bb, i)
654654
}
655655

656656
query predicate deadDef(RelevantDefinition def, SourceVariable v) {
657657
v = def.getSourceVariable() and
658658
not ssaDefReachesRead(_, def, _, _) and
659-
not phiHasInputFromBlock(_, def, _)
659+
not phiHasInputFromBlock(_, def, _) and
660+
not uncertainWriteDefinitionInput(_, def)
660661
}
661662
}

csharp/ql/lib/semmle/code/csharp/dataflow/internal/basessa/SsaImplCommon.qll

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -645,17 +645,18 @@ module Consistency {
645645

646646
query predicate nonUniqueDef(RelevantDefinition def, SourceVariable v, BasicBlock bb, int i) {
647647
ssaDefReachesRead(v, def, bb, i) and
648-
not exists(unique(Definition def0 | ssaDefReachesRead(_, def0, bb, i)))
648+
not exists(unique(Definition def0 | ssaDefReachesRead(v, def0, bb, i)))
649649
}
650650

651651
query predicate readWithoutDef(SourceVariable v, BasicBlock bb, int i) {
652652
variableRead(bb, i, v, _) and
653-
not ssaDefReachesRead(_, _, bb, i)
653+
not ssaDefReachesRead(v, _, bb, i)
654654
}
655655

656656
query predicate deadDef(RelevantDefinition def, SourceVariable v) {
657657
v = def.getSourceVariable() and
658658
not ssaDefReachesRead(_, def, _, _) and
659-
not phiHasInputFromBlock(_, def, _)
659+
not phiHasInputFromBlock(_, def, _) and
660+
not uncertainWriteDefinitionInput(_, def)
660661
}
661662
}

0 commit comments

Comments
 (0)