mirror of
https://github.com/github/codeql.git
synced 2026-04-26 09:15:12 +02:00
Fix OS specific tests
This commit is contained in:
@@ -9,9 +9,6 @@ attrNoArg
|
||||
| Interop.Sys.<>c__DisplayClass37_0 | [CompilerGeneratedAttribute(...)] |
|
||||
| Interop.Sys.FileStatusFlags | [FlagsAttribute(...)] |
|
||||
| Interop.Sys.OpenFlags | [FlagsAttribute(...)] |
|
||||
| Interop.libobjc.NSOperatingSystemVersion.majorVersion | [NativeIntegerAttribute(...)] |
|
||||
| Interop.libobjc.NSOperatingSystemVersion.minorVersion | [NativeIntegerAttribute(...)] |
|
||||
| Interop.libobjc.NSOperatingSystemVersion.patchVersion | [NativeIntegerAttribute(...)] |
|
||||
| InteropErrorExtensions | [ExtensionAttribute(...)] |
|
||||
| Microsoft.CodeAnalysis.EmbeddedAttribute | [CompilerGeneratedAttribute(...)] |
|
||||
| Microsoft.CodeAnalysis.EmbeddedAttribute | [EmbeddedAttribute(...)] |
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
import semmle.code.cil.Attribute
|
||||
import semmle.code.cil.Declaration
|
||||
|
||||
private predicate isOsSpecific(Declaration d) { d.getQualifiedName().matches("%libobjc%") }
|
||||
|
||||
query predicate attrNoArg(string dec, string attr) {
|
||||
exists(Declaration d, Attribute a |
|
||||
not isOsSpecific(d) and
|
||||
a.getDeclaration() = d and
|
||||
not exists(a.getAnArgument())
|
||||
|
|
||||
@@ -14,6 +17,7 @@ query predicate attrNoArg(string dec, string attr) {
|
||||
query predicate attrArgNamed(string dec, string attr, string name, string value) {
|
||||
exists(Declaration d, Attribute a |
|
||||
a.getDeclaration() = d and
|
||||
not isOsSpecific(d) and
|
||||
a.getNamedArgument(name) = value
|
||||
|
|
||||
dec = d.toStringWithTypes() and
|
||||
@@ -24,6 +28,7 @@ query predicate attrArgNamed(string dec, string attr, string name, string value)
|
||||
query predicate attrArgPositional(string dec, string attr, int index, string value) {
|
||||
exists(Declaration d, Attribute a |
|
||||
a.getDeclaration() = d and
|
||||
not isOsSpecific(d) and
|
||||
a.getArgument(index) = value
|
||||
|
|
||||
dec = d.toStringWithTypes() and
|
||||
|
||||
@@ -923,7 +923,6 @@
|
||||
| Parameter 1 of SetException | parameter | 32 |
|
||||
| Parameter 1 of SetNotificationForWaitCompletion | parameter | 32 |
|
||||
| Parameter 1 of SetValue | parameter | 32 |
|
||||
| Parameter 1 of SkipWhitespace | parameter | 32 |
|
||||
| Parameter 1 of SnapForObservation | parameter | 32 |
|
||||
| Parameter 1 of SplitName | parameter | 32 |
|
||||
| Parameter 1 of Start | parameter | 32 |
|
||||
@@ -1038,7 +1037,6 @@
|
||||
| Parameter 1 of UInt32ToNumber | parameter | 32 |
|
||||
| Parameter 1 of UInt64ToNumber | parameter | 32 |
|
||||
| Parameter 1 of Unscale | parameter | 32 |
|
||||
| Parameter 1 of ValidateVariableAndValue | parameter | 32 |
|
||||
| Parameter 1 of VarDecCmp | parameter | 32 |
|
||||
| Parameter 1 of VarDecCmpSub | parameter | 32 |
|
||||
| Parameter 1 of VarDecDiv | parameter | 32 |
|
||||
@@ -1318,7 +1316,6 @@
|
||||
| Parameter 2 of TryGetStringValue | parameter | 32 |
|
||||
| Parameter 2 of TryGetTimeZone | parameter | 32 |
|
||||
| Parameter 2 of TryGetTimeZoneFromLocalMachine | parameter | 32 |
|
||||
| Parameter 2 of TryGetUserNameFromPasswd | parameter | 32 |
|
||||
| Parameter 2 of TryGetValue | parameter | 32 |
|
||||
| Parameter 2 of TryGetValueWorker | parameter | 32 |
|
||||
| Parameter 2 of TryLoadTzFile | parameter | 32 |
|
||||
|
||||
@@ -21,5 +21,11 @@ private string elementType(Element e) {
|
||||
}
|
||||
|
||||
from Element e, int i
|
||||
where cil_type_annotation(e, i)
|
||||
where
|
||||
cil_type_annotation(e, i) and
|
||||
(
|
||||
not e instanceof Parameter or
|
||||
e.(Parameter).getDeclaringElement().(Method).getDeclaringType().getQualifiedName() !=
|
||||
"System.Environment" // There are OS specific methods in this class
|
||||
)
|
||||
select e.toString(), elementType(e), i
|
||||
|
||||
Reference in New Issue
Block a user