File tree Expand file tree Collapse file tree 3 files changed +33
-0
lines changed Expand file tree Collapse file tree 3 files changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ | tst.go:4:6:4:8 | "a" | a |
2+ | tst.go:4:6:4:14 | ...+... | <no string value stored> |
3+ | tst.go:4:6:4:20 | ...+... | <no string value stored> |
4+ | tst.go:4:6:4:26 | ...+... | <no string value stored> |
5+ | tst.go:4:6:4:32 | ...+... | <no string value stored> |
6+ | tst.go:4:6:4:38 | ...+... | abcdef |
7+ | tst.go:4:12:4:14 | "b" | b |
8+ | tst.go:4:18:4:20 | "c" | c |
9+ | tst.go:4:24:4:26 | "d" | d |
10+ | tst.go:4:30:4:32 | "e" | e |
11+ | tst.go:4:36:4:38 | "f" | f |
Original file line number Diff line number Diff line change 1+ package main
2+
3+ func main () {
4+ _ = "a" + "b" + "c" + "d" + "e" + "f"
5+ }
Original file line number Diff line number Diff line change 1+ import go
2+
3+ string checkStringValue ( Expr e ) {
4+ result = e .getStringValue ( )
5+ or
6+ not exists ( e .getStringValue ( ) ) and result = "<no string value stored>"
7+ }
8+
9+ from Expr e
10+ where e .getType ( ) instanceof StringType
11+ // We should get string values for `"a"`, `"b"`, `"c"` and `"a" + "b" + "c"
12+ // but not `"a" + "b"`. In the extractor we avoid storing the value of
13+ // intermediate strings in string concatenations because in pathological cases
14+ // this could lead to a quadratic blowup in the size of string values stored,
15+ // which then causes performance problems when we iterate through all string
16+ // values.
17+ select e , checkStringValue ( e )
You can’t perform that action at this time.
0 commit comments