Skip to content

Commit c5755ba

Browse files
committed
C++: Remove a DefinitionExt reference.
1 parent 0c17786 commit c5755ba

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1371,7 +1371,7 @@ class UninitializedNode extends Node {
13711371
LocalVariable v;
13721372

13731373
UninitializedNode() {
1374-
exists(Ssa::DefinitionExt def, Ssa::SourceVariable sv |
1374+
exists(Ssa::Definition def, Ssa::SourceVariable sv |
13751375
def.getIndirectionIndex() = 0 and
13761376
def.getValue().asInstruction() instanceof UninitializedInstruction and
13771377
Ssa::defToNode(this, def, sv, _, _, _) and

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

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -698,9 +698,9 @@ predicate outNodeHasAddressAndIndex(
698698
* Holds if `node` is the node that corresponds to the definition of `def`.
699699
*/
700700
predicate defToNode(
701-
Node node, DefinitionExt def, SourceVariable sv, IRBlock bb, int i, boolean uncertain
701+
Node node, Definition def, SourceVariable sv, IRBlock bb, int i, boolean uncertain
702702
) {
703-
def.definesAt(sv, bb, i, _) and
703+
def.definesAt(sv, bb, i) and
704704
(
705705
nodeHasOperand(node, def.getValue().asOperand(), def.getIndirectionIndex())
706706
or
@@ -1132,6 +1132,26 @@ class PhiNode extends SsaImpl::DefinitionExt {
11321132
final DefinitionExt getAnInput() { this.hasInputFromBlock(result, _, _, _, _) }
11331133
}
11341134

1135+
/** An static single assignment (SSA) definition. */
1136+
class Definition extends SsaImpl::Definition {
1137+
/**
1138+
* INTERNAL: Do not use.
1139+
*/
1140+
Node0Impl getValue() { result = getDefImpl(this).getValue() }
1141+
1142+
/** Gets the indirection index of this definition. */
1143+
int getIndirectionIndex() { result = getDefImpl(this).getIndirectionIndex() }
1144+
1145+
/** Gets the indirection of this definition. */
1146+
int getIndirection() { result = getDefImpl(this).getIndirection() }
1147+
1148+
/**
1149+
* Holds if this definition is guaranteed to totally overwrite the buffer
1150+
* being written to.
1151+
*/
1152+
predicate isCertain() { getDefImpl(this).isCertain() }
1153+
}
1154+
11351155
/** An static single assignment (SSA) definition. */
11361156
class DefinitionExt extends SsaImpl::DefinitionExt {
11371157
private DefinitionExt getAPhiInputOrPriorDefinition() { result = this.(PhiNode).getAnInput() }

0 commit comments

Comments
 (0)