Skip to content

Commit 389294b

Browse files
authored
Merge pull request github#13920 from MathiasVP/fix-out-nodes
C++: Remove unnecessary predicates
2 parents a1234d4 + 2a1d5b7 commit 389294b

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

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

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -781,26 +781,12 @@ class IndirectArgumentOutNode extends Node, TIndirectArgumentOutNode, PartialDef
781781
override Expr getDefinedExpr() { result = operand.getDef().getUnconvertedResultExpression() }
782782
}
783783

784-
pragma[nomagic]
785-
predicate indirectReturnOutNodeOperand0(CallInstruction call, Operand operand, int indirectionIndex) {
786-
Ssa::hasRawIndirectInstruction(call, indirectionIndex) and
787-
operandForFullyConvertedCall(operand, call)
788-
}
789-
790-
pragma[nomagic]
791-
predicate indirectReturnOutNodeInstruction0(
792-
CallInstruction call, Instruction instr, int indirectionIndex
793-
) {
794-
Ssa::hasRawIndirectInstruction(call, indirectionIndex) and
795-
instructionForFullyConvertedCall(instr, call)
796-
}
797-
798784
/**
799785
* Holds if `node` is an indirect operand with columns `(operand, indirectionIndex)`, and
800786
* `operand` represents a use of the fully converted value of `call`.
801787
*/
802788
private predicate hasOperand(Node node, CallInstruction call, int indirectionIndex, Operand operand) {
803-
indirectReturnOutNodeOperand0(call, operand, indirectionIndex) and
789+
operandForFullyConvertedCall(operand, call) and
804790
hasOperandAndIndex(node, operand, indirectionIndex)
805791
}
806792

@@ -813,7 +799,7 @@ private predicate hasOperand(Node node, CallInstruction call, int indirectionInd
813799
private predicate hasInstruction(
814800
Node node, CallInstruction call, int indirectionIndex, Instruction instr
815801
) {
816-
indirectReturnOutNodeInstruction0(call, instr, indirectionIndex) and
802+
instructionForFullyConvertedCall(instr, call) and
817803
hasInstructionAndIndex(node, instr, indirectionIndex)
818804
}
819805

0 commit comments

Comments
 (0)