mirror of
https://github.com/github/codeql.git
synced 2025-12-20 10:46:30 +01:00
C++: Override toString on argument indirections
Without this override, end users would see the string `BufferReadSideEffect` in path explanations.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user