mirror of
https://github.com/github/codeql.git
synced 2025-12-20 18:56:32 +01:00
C++: Map more expressions to operand nodes.
This commit is contained in:
@@ -770,32 +770,11 @@ class RawIndirectInstruction extends Node, TRawIndirectInstruction {
|
||||
}
|
||||
}
|
||||
|
||||
private predicate isFullyConvertedArgument(Expr e) {
|
||||
exists(Call call |
|
||||
e = call.getAnArgument().getFullyConverted()
|
||||
or
|
||||
e = call.getQualifier().getFullyConverted()
|
||||
)
|
||||
}
|
||||
|
||||
private predicate isFullyConvertedCall(Expr e) { e = any(Call call).getFullyConverted() }
|
||||
|
||||
/** Holds if `Node::asExpr` should map an some operand node to `e`. */
|
||||
private predicate convertedExprMustBeOperand(Expr e) {
|
||||
isFullyConvertedArgument(e)
|
||||
or
|
||||
isFullyConvertedCall(e)
|
||||
}
|
||||
|
||||
/** Holds if `node` is an `OperandNode` that should map `node.asExpr()` to `e`. */
|
||||
predicate exprNodeShouldBeOperand(OperandNode node, Expr e) {
|
||||
exists(Operand operand |
|
||||
node.getOperand() = operand and
|
||||
e = operand.getDef().getConvertedResultExpression()
|
||||
|
|
||||
convertedExprMustBeOperand(e)
|
||||
or
|
||||
node.(IndirectOperand).isIRRepresentationOf(_, _)
|
||||
exists(Instruction def |
|
||||
unique( | | getAUse(def)) = node.getOperand() and
|
||||
e = def.getConvertedResultExpression()
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user