mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
C++: Remove a DefinitionExt reference.
This commit is contained in:
@@ -1371,7 +1371,7 @@ class UninitializedNode extends Node {
|
||||
LocalVariable v;
|
||||
|
||||
UninitializedNode() {
|
||||
exists(Ssa::DefinitionExt def, Ssa::SourceVariable sv |
|
||||
exists(Ssa::Definition def, Ssa::SourceVariable sv |
|
||||
def.getIndirectionIndex() = 0 and
|
||||
def.getValue().asInstruction() instanceof UninitializedInstruction and
|
||||
Ssa::defToNode(this, def, sv, _, _, _) and
|
||||
|
||||
@@ -698,9 +698,9 @@ predicate outNodeHasAddressAndIndex(
|
||||
* Holds if `node` is the node that corresponds to the definition of `def`.
|
||||
*/
|
||||
predicate defToNode(
|
||||
Node node, DefinitionExt def, SourceVariable sv, IRBlock bb, int i, boolean uncertain
|
||||
Node node, Definition def, SourceVariable sv, IRBlock bb, int i, boolean uncertain
|
||||
) {
|
||||
def.definesAt(sv, bb, i, _) and
|
||||
def.definesAt(sv, bb, i) and
|
||||
(
|
||||
nodeHasOperand(node, def.getValue().asOperand(), def.getIndirectionIndex())
|
||||
or
|
||||
@@ -1132,6 +1132,26 @@ class PhiNode extends SsaImpl::DefinitionExt {
|
||||
final DefinitionExt getAnInput() { this.hasInputFromBlock(result, _, _, _, _) }
|
||||
}
|
||||
|
||||
/** An static single assignment (SSA) definition. */
|
||||
class Definition extends SsaImpl::Definition {
|
||||
/**
|
||||
* INTERNAL: Do not use.
|
||||
*/
|
||||
Node0Impl getValue() { result = getDefImpl(this).getValue() }
|
||||
|
||||
/** Gets the indirection index of this definition. */
|
||||
int getIndirectionIndex() { result = getDefImpl(this).getIndirectionIndex() }
|
||||
|
||||
/** Gets the indirection of this definition. */
|
||||
int getIndirection() { result = getDefImpl(this).getIndirection() }
|
||||
|
||||
/**
|
||||
* Holds if this definition is guaranteed to totally overwrite the buffer
|
||||
* being written to.
|
||||
*/
|
||||
predicate isCertain() { getDefImpl(this).isCertain() }
|
||||
}
|
||||
|
||||
/** An static single assignment (SSA) definition. */
|
||||
class DefinitionExt extends SsaImpl::DefinitionExt {
|
||||
private DefinitionExt getAPhiInputOrPriorDefinition() { result = this.(PhiNode).getAnInput() }
|
||||
|
||||
Reference in New Issue
Block a user