File tree 4 files changed +36
-0
lines changed
test/library-tests/diagnostics
4 files changed +36
-0
lines changed Original file line number Diff line number Diff line change
1
+ /**
2
+ * @name Extraction errors
3
+ * @description List all errors reported by the extractor. The returned issues are
4
+ * limited to those files where there are no compilation errors. This
5
+ * indicates a bug or limitation in the extractor, and could lead to
6
+ * inaccurate results.
7
+ * @kind diagnostic
8
+ * @id cs/diagnostics/extraction-errors
9
+ */
10
+
11
+ import csharp
12
+ import semmle.code.csharp.commons.Diagnostics
13
+
14
+ from ExtractorError error
15
+ where not exists ( CompilerError ce | ce .getLocation ( ) .getFile ( ) = error .getLocation ( ) .getFile ( ) )
16
+ select error ,
17
+ "Unexpected " + error .getOrigin ( ) + " error: " + error .getText ( ) + " in " +
18
+ error .getLocation ( ) .getFile ( ) , 3
Original file line number Diff line number Diff line change
1
+ Diagnostics/DiagnosticExtractionErrors.ql
Original file line number Diff line number Diff line change
1
+ // semmle-extractor-options: --standalone
2
+
3
+ using System ;
4
+
5
+ class Class
6
+ {
7
+ static void Main ( string [ ] args )
8
+ {
9
+ int z = GetParamLength ( __arglist ( 1 , 2 ) ) ;
10
+ }
11
+
12
+ public static int GetParamLength ( __arglist )
13
+ {
14
+ ArgIterator iterator = new ArgIterator ( __arglist ) ;
15
+ return iterator . GetRemainingCount ( ) ;
16
+ }
17
+ }
You can’t perform that action at this time.
0 commit comments