File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
ruby/ql/lib/codeql/ruby/controlflow Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -108,6 +108,7 @@ class ExprCfgNode extends AstCfgNode {
108108 }
109109
110110 /** Gets the textual (constant) value of this expression, if any. */
111+ cached
111112 string getValueText ( ) { result = this .getSource ( ) .getValueText ( ) }
112113}
113114
@@ -247,7 +248,18 @@ module ExprNodes {
247248 result = ( left .toFloat ( ) + right .toFloat ( ) ) .toString ( )
248249 or
249250 not ( exists ( left .toFloat ( ) ) and exists ( right .toFloat ( ) ) ) and
250- result = left + right
251+ exists ( int l , int r , int limit |
252+ l = left .length ( ) and
253+ r = right .length ( ) and
254+ limit = 10000
255+ |
256+ if l > limit
257+ then result = left .prefix ( limit ) + "..."
258+ else
259+ if l + r > limit
260+ then result = left + right .prefix ( limit - l ) + "..."
261+ else result = left + right
262+ )
251263 )
252264 or
253265 op = "-" and
You can’t perform that action at this time.
0 commit comments