C++: Override toString on argument indirections

Without this override, end users would see the string
`BufferReadSideEffect` in path explanations.
This commit is contained in:
Jonas Jensen
2020-06-03 13:04:10 +02:00
parent 10dfa497a5
commit 8f702d4b49
2 changed files with 29 additions and 15 deletions

View File

@@ -387,6 +387,20 @@ class DefinitionByReferenceNode extends InstructionNode {
}
}
/**
* A node representing the memory pointed to by a function argument.
*
* This class exists only in order to override `toString`, which would
* otherwise be the default implementation inherited from `InstructionNode`.
*/
private class ArgumentIndirectionNode extends InstructionNode {
override ReadSideEffectInstruction instr;
override string toString() {
result = "Argument " + instr.getIndex() + " indirection"
}
}
/**
* A `Node` corresponding to a variable in the program, as opposed to the
* value of that variable at some particular point. This can be used for