Skip to content

Commit 754612d

Browse files
committed
C++: Split valuetext off into its own table
1 parent 1bd0c69 commit 754612d

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ class Expr extends StmtParent, @expr {
8585
override string toString() { none() }
8686

8787
/** Gets the value of this expression, if it is a constant. */
88-
string getValue() { exists(@value v | values(v,result,_) and valuebind(v,underlyingElement(this))) }
88+
string getValue() { exists(@value v | values(v,result) and valuebind(v,underlyingElement(this))) }
8989

9090
/** Gets the source text for the value of this expression, if it is a constant. */
91-
string getValueText() { exists(@value v | values(v,_,result) and valuebind(v,underlyingElement(this))) }
91+
string getValueText() { exists(@value v | valuetext(v,result) and valuebind(v,underlyingElement(this))) }
9292

9393
/** Holds if this expression has a value that can be determined at compile time. */
9494
cached

cpp/ql/src/semmlecode.cpp.dbscheme

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,11 +1237,15 @@ expr_cond_false(
12371237
int false: @expr ref
12381238
);
12391239

1240-
// the second field is a string representation of the value
1241-
// the third field is the actual text in the source or the same as the second field
1240+
/** A string representation of the value. */
12421241
values(
12431242
unique int id: @value,
1244-
string str: string ref,
1243+
string str: string ref
1244+
);
1245+
1246+
/** The actual text in the source code for the value, if any. */
1247+
valuetext(
1248+
unique int id: @value ref,
12451249
string text: string ref
12461250
);
12471251

0 commit comments

Comments
 (0)