File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
cpp/ql/lib/semmle/code/cpp Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -84,6 +84,7 @@ private int fileHeaderLimit(File f) {
84
84
fc = fileFirstComment ( f ) and
85
85
result =
86
86
min ( int line |
87
+ // code ending the initial comments
87
88
exists ( DeclarationEntry de , Location l |
88
89
l = de .getLocation ( ) and
89
90
l .getFile ( ) = f and
@@ -105,7 +106,13 @@ private int fileHeaderLimit(File f) {
105
106
line > fc
106
107
)
107
108
or
109
+ // end of the file
108
110
line = f .getMetrics ( ) .getNumberOfLines ( )
111
+ or
112
+ // rarely, we've seen extremely long sequences of initial comments
113
+ // (and/or limitations in the above constraints) cause an overflow of
114
+ // the maximum string length. So don't look past 1000 lines regardless.
115
+ line = 1000
109
116
)
110
117
)
111
118
}
You can’t perform that action at this time.
0 commit comments