mirror of
https://github.com/github/codeql.git
synced 2025-12-18 01:33:15 +01:00
C++: Manual recursion in skipCopyValueInstructions instead of transitive closure
This commit is contained in:
@@ -355,14 +355,16 @@ private class ArrayToPointerConvertInstruction extends ConvertInstruction {
|
||||
}
|
||||
}
|
||||
|
||||
private Instruction skipOneCopyValueInstruction(Instruction instr) {
|
||||
not instr instanceof CopyValueInstruction and result = instr
|
||||
private Instruction skipOneCopyValueInstructionRec(CopyValueInstruction copy) {
|
||||
copy.getUnary() = result and not result instanceof CopyValueInstruction
|
||||
or
|
||||
result = instr.(CopyValueInstruction).getUnary()
|
||||
result = skipOneCopyValueInstructionRec(copy.getUnary())
|
||||
}
|
||||
|
||||
private Instruction skipCopyValueInstructions(Instruction instr) {
|
||||
result = skipOneCopyValueInstruction*(instr) and not result instanceof CopyValueInstruction
|
||||
not result instanceof CopyValueInstruction and result = instr
|
||||
or
|
||||
result = skipOneCopyValueInstructionRec(instr)
|
||||
}
|
||||
|
||||
private predicate arrayReadStep(Node node1, ArrayContent a, Node node2) {
|
||||
|
||||
Reference in New Issue
Block a user