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) {
8484 fc = fileFirstComment ( f ) and
8585 result =
8686 min ( int line |
87+ // code ending the initial comments
8788 exists ( DeclarationEntry de , Location l |
8889 l = de .getLocation ( ) and
8990 l .getFile ( ) = f and
@@ -105,7 +106,13 @@ private int fileHeaderLimit(File f) {
105106 line > fc
106107 )
107108 or
109+ // end of the file
108110 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
109116 )
110117 )
111118}
You can’t perform that action at this time.
0 commit comments