C++: Fix IR edge case where there are no function calls taking an argument

This commit is contained in:
Jeroen Ketema
2025-05-14 13:44:29 +02:00
parent 96bd9a96e5
commit 401281331f
2 changed files with 14 additions and 8 deletions

View File

@@ -67,8 +67,13 @@ class Class = Cpp::Class; // Used for inheritance conversions
predicate hasCaseEdge(string minValue, string maxValue) { hasCaseEdge(_, minValue, maxValue) }
predicate hasPositionalArgIndex(int argIndex) {
exists(Cpp::FunctionCall call | exists(call.getArgument(argIndex))) or
exists(Cpp::FunctionCall call | exists(call.getArgument(argIndex)))
or
exists(Cpp::BuiltInOperation op | exists(op.getChild(argIndex)))
or
// Ensure we are always able to output the argument of a call to the delete operator.
exists(Cpp::DeleteExpr d) and
argIndex = 0
}
predicate hasAsmOperandIndex(int operandIndex) {