We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 24567c5 + f44f8d5 commit 1d202ddCopy full SHA for 1d202dd
cpp/ql/test/library-tests/declspec/guard/test.cpp
@@ -0,0 +1,8 @@
1
+// semmle-extractor-options: --edg --microsoft
2
+
3
+void f(__declspec(guard(overflow)) size_t length) {
4
+}
5
6
+__declspec(guard(ignore))
7
+void g(void) {
8
cpp/ql/test/library-tests/declspec/guard/test.expected
@@ -0,0 +1,2 @@
+| test.cpp:3:6:3:6 | f | 0 | length |
+| test.cpp:7:6:7:6 | g | -1 | <none> |
cpp/ql/test/library-tests/declspec/guard/test.ql
@@ -0,0 +1,10 @@
+import cpp
+// What we select here isn't too important; we're just testing the
+// __declspec(guard(...)) attributes don't cause extractor errors.
+from Function f, string p, int n
+where if f.getNumberOfParameters() = 0
+ then (p = "<none>" and n = -1)
9
+ else p = f.getParameter(n).toString()
10
+select f, n, p
0 commit comments