We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 754612d commit 95794f9Copy full SHA for 95794f9
cpp/ql/src/semmle/code/cpp/exprs/Expr.qll
@@ -88,7 +88,13 @@ class Expr extends StmtParent, @expr {
88
string getValue() { exists(@value v | values(v,result) and valuebind(v,underlyingElement(this))) }
89
90
/** Gets the source text for the value of this expression, if it is a constant. */
91
- string getValueText() { exists(@value v | valuetext(v,result) and valuebind(v,underlyingElement(this))) }
+ string getValueText() {
92
+ exists(@value v |
93
+ valuebind(v,underlyingElement(this)) and
94
+ if valuetext(v, _)
95
+ then valuetext(v, result)
96
+ else values(v, result))
97
+ }
98
99
/** Holds if this expression has a value that can be determined at compile time. */
100
cached
0 commit comments