mirror of
https://github.com/github/codeql.git
synced 2025-12-18 18:10:39 +01:00
C++: Move conflation check into each disjunct.
This commit is contained in:
@@ -744,10 +744,9 @@ private FieldNode getOutermostFieldNode(Instruction address) {
|
|||||||
|
|
||||||
private predicate flowIntoReadNode(Node nodeFrom, FieldNode nodeTo) {
|
private predicate flowIntoReadNode(Node nodeFrom, FieldNode nodeTo) {
|
||||||
// flow from the memory of a load to the "outermost" field of that load.
|
// flow from the memory of a load to the "outermost" field of that load.
|
||||||
not nodeFrom.asInstruction().isResultConflated() and
|
|
||||||
(
|
|
||||||
exists(LoadInstruction load |
|
exists(LoadInstruction load |
|
||||||
nodeTo = getOutermostFieldNode(load.getSourceAddress()) and
|
nodeTo = getOutermostFieldNode(load.getSourceAddress()) and
|
||||||
|
not nodeFrom.asInstruction().isResultConflated() and
|
||||||
nodeFrom.asInstruction() = load.getSourceValueOperand().getAnyDef()
|
nodeFrom.asInstruction() = load.getSourceValueOperand().getAnyDef()
|
||||||
)
|
)
|
||||||
or
|
or
|
||||||
@@ -757,14 +756,15 @@ private predicate flowIntoReadNode(Node nodeFrom, FieldNode nodeTo) {
|
|||||||
exists(StoreInstruction store, ChiInstruction chi |
|
exists(StoreInstruction store, ChiInstruction chi |
|
||||||
chi.getPartial() = store and
|
chi.getPartial() = store and
|
||||||
nodeTo = getOutermostFieldNode(store.getDestinationAddress()) and
|
nodeTo = getOutermostFieldNode(store.getDestinationAddress()) and
|
||||||
|
not nodeFrom.asInstruction().isResultConflated() and
|
||||||
nodeFrom.asInstruction() = chi.getTotal()
|
nodeFrom.asInstruction() = chi.getTotal()
|
||||||
)
|
)
|
||||||
)
|
|
||||||
or
|
or
|
||||||
exists(ReadSideEffectInstruction read |
|
exists(ReadSideEffectInstruction read, SideEffectOperand sideEffect |
|
||||||
not read.getSideEffectOperand().getAnyDef().isResultConflated() and
|
sideEffect = read.getSideEffectOperand() and
|
||||||
|
not sideEffect.getAnyDef().isResultConflated() and
|
||||||
nodeTo = getOutermostFieldNode(read.getArgumentDef()) and
|
nodeTo = getOutermostFieldNode(read.getArgumentDef()) and
|
||||||
nodeFrom.asOperand() = read.getSideEffectOperand()
|
nodeFrom.asOperand() = sideEffect
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user