C++: Move conflation check into each disjunct.

This commit is contained in:
Mathias Vorreiter Pedersen
2020-12-22 16:56:30 +01:00
parent d2d8377e88
commit 6545d0b53a

View File

@@ -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
) )
} }