mirror of
https://github.com/github/codeql.git
synced 2026-05-01 19:55:15 +02:00
Ruby: Truncate concatenated strings in getValueText
This commit is contained in:
@@ -108,6 +108,7 @@ class ExprCfgNode extends AstCfgNode {
|
||||
}
|
||||
|
||||
/** Gets the textual (constant) value of this expression, if any. */
|
||||
cached
|
||||
string getValueText() { result = this.getSource().getValueText() }
|
||||
}
|
||||
|
||||
@@ -247,7 +248,18 @@ module ExprNodes {
|
||||
result = (left.toFloat() + right.toFloat()).toString()
|
||||
or
|
||||
not (exists(left.toFloat()) and exists(right.toFloat())) and
|
||||
result = left + right
|
||||
exists(int l, int r, int limit |
|
||||
l = left.length() and
|
||||
r = right.length() and
|
||||
limit = 10000
|
||||
|
|
||||
if l > limit
|
||||
then result = left.prefix(limit) + "..."
|
||||
else
|
||||
if l + r > limit
|
||||
then result = left + right.prefix(limit - l) + "..."
|
||||
else result = left + right
|
||||
)
|
||||
)
|
||||
or
|
||||
op = "-" and
|
||||
|
||||
Reference in New Issue
Block a user