mirror of
https://github.com/github/codeql.git
synced 2025-12-18 09:43:15 +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) {
|
||||
// flow from the memory of a load to the "outermost" field of that load.
|
||||
not nodeFrom.asInstruction().isResultConflated() and
|
||||
(
|
||||
exists(LoadInstruction load |
|
||||
nodeTo = getOutermostFieldNode(load.getSourceAddress()) and
|
||||
not nodeFrom.asInstruction().isResultConflated() and
|
||||
nodeFrom.asInstruction() = load.getSourceValueOperand().getAnyDef()
|
||||
)
|
||||
or
|
||||
@@ -757,14 +756,15 @@ private predicate flowIntoReadNode(Node nodeFrom, FieldNode nodeTo) {
|
||||
exists(StoreInstruction store, ChiInstruction chi |
|
||||
chi.getPartial() = store and
|
||||
nodeTo = getOutermostFieldNode(store.getDestinationAddress()) and
|
||||
not nodeFrom.asInstruction().isResultConflated() and
|
||||
nodeFrom.asInstruction() = chi.getTotal()
|
||||
)
|
||||
)
|
||||
or
|
||||
exists(ReadSideEffectInstruction read |
|
||||
not read.getSideEffectOperand().getAnyDef().isResultConflated() and
|
||||
exists(ReadSideEffectInstruction read, SideEffectOperand sideEffect |
|
||||
sideEffect = read.getSideEffectOperand() and
|
||||
not sideEffect.getAnyDef().isResultConflated() and
|
||||
nodeTo = getOutermostFieldNode(read.getArgumentDef()) and
|
||||
nodeFrom.asOperand() = read.getSideEffectOperand()
|
||||
nodeFrom.asOperand() = sideEffect
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user