Skip to content

Commit 28832c9

Browse files
committed
C++: Add a comment
1 parent 3951974 commit 28832c9

File tree

1 file changed

+9
-0
lines changed
  • cpp/ql/src/semmle/code/cpp/exprs

1 file changed

+9
-0
lines changed

cpp/ql/src/semmle/code/cpp/exprs/Expr.qll

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,16 @@ class Expr extends StmtParent, @expr {
8787
/** Gets the value of this expression, if it is a constant. */
8888
string getValue() { exists(@value v | values(v,result) and valuebind(v,underlyingElement(this))) }
8989

90+
/**
91+
* Walk along the sequence of `getConversion()s` until we reach
92+
* one with a valuetext, and then return that valuetext, if any.
93+
* For example, in an invocation of `#define THREE (1+2)`, there
94+
* will not be a valuetext for `1+2`, but the conversion `(1+2)`
95+
* will have valuetext `THREE`.
96+
*/
9097
private string getValueTextFollowingConversions(Expr e) {
98+
e = this.getConversion*()
99+
and
91100
e.getValue() = this.getValue()
92101
and
93102
(if exists(@value v |

0 commit comments

Comments
 (0)