mirror of
https://github.com/github/codeql.git
synced 2026-04-26 17:25:19 +02:00
C#: Adjustments to test cases.
This commit is contained in:
@@ -5,10 +5,11 @@ private predicate isOsSpecific(Declaration d) {
|
||||
d.getFullyQualifiedName()
|
||||
.matches("%" +
|
||||
[
|
||||
"libobjc", "libproc", "libc", "Interop.Sys",
|
||||
"libobjc", "libproc", "libc", "Interop.OSReleaseFile", "Interop.Sys",
|
||||
"System.Runtime.InteropServices.ObjectiveC.ObjectiveCMarshal",
|
||||
"System.Diagnostics.Tracing.XplatEventLogger", "System.Threading.AutoreleasePool",
|
||||
"System.CLRConfig", "System.Diagnostics.Tracing.EventSource.<WriteEventString>",
|
||||
"System.IO.FileSystem.<TryCloneFile>"
|
||||
] + "%")
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,16 @@
|
||||
import semmle.code.cil.Types
|
||||
import semmle.code.csharp.commons.QualifiedName
|
||||
|
||||
predicate osSpecific(string qualifier, string name) {
|
||||
qualifier = "Interop.Sys" and
|
||||
(
|
||||
name = "LockType" or // doesn't exist on osx
|
||||
name = "NSSearchPathDirectory" // doesn't exist on linux.
|
||||
)
|
||||
}
|
||||
|
||||
from Enum e, string qualifier, string name
|
||||
where
|
||||
e.hasFullyQualifiedName(qualifier, name) and
|
||||
not (qualifier = "Interop.Sys" and name = "LockType") // doesn't exist on osx
|
||||
not osSpecific(qualifier, name)
|
||||
select getQualifiedName(qualifier, name), e.getUnderlyingType().toStringWithTypes()
|
||||
|
||||
@@ -58,14 +58,20 @@ private predicate exclude(string s) {
|
||||
"Parameter 1 of System.CLRConfig.GetConfigBoolValue",
|
||||
"Parameter 1 of System.Runtime.InteropServices.ObjectiveC.ObjectiveCMarshal.CreateReferenceTrackingHandleInternal",
|
||||
"Parameter 2 of System.Runtime.InteropServices.ObjectiveC.ObjectiveCMarshal.CreateReferenceTrackingHandleInternal",
|
||||
"Parameter 2 of Interop.OSReleaseFile.<GetPrettyName>g__TryGetFieldValue|1_0",
|
||||
"Parameter 2 of System.Runtime.InteropServices.ObjectiveC.ObjectiveCMarshal.InvokeUnhandledExceptionPropagation",
|
||||
"Parameter 3 of System.IO.FileSystem.<TryCloneFile>g__TryCloneFile|5_0",
|
||||
"Parameter 3 of System.IO.FileSystem.TryCloneFile",
|
||||
"Parameter 6 of Microsoft.Win32.SafeHandles.SafeFileHandle.OpenNoFollowSymlink",
|
||||
"Local variable 1 of method Interop.libobjc.NSOperatingSystemVersion_objc_msgSend_stret",
|
||||
"Local variable 1 of method System.Diagnostics.Tracing.XplatEventLogger.LogEventSource",
|
||||
"Local variable 2 of method System.Runtime.InteropServices.ObjectiveC.ObjectiveCMarshal.CreateReferenceTrackingHandleInternal",
|
||||
"Local variable 3 of method System.Diagnostics.Tracing.XplatEventLogger.LogEventSource",
|
||||
"Local variable 4 of method System.CLRConfig.GetConfigBoolValue",
|
||||
"Local variable 4 of method System.Runtime.InteropServices.ObjectiveC.ObjectiveCMarshal.CreateReferenceTrackingHandleInternal",
|
||||
"Local variable 5 of method Interop.OSReleaseFile.<GetPrettyName>g__TryGetFieldValue|1_0",
|
||||
"Local variable 5 of method System.Diagnostics.Tracing.XplatEventLogger.LogEventSource",
|
||||
"Local variable 13 of method Interop.procfs.TryParseStatusFile",
|
||||
"Parameter 0 of System.Diagnostics.Tracing.XplatEventLogger.AppendByteArrayAsHexString",
|
||||
"Parameter 1 of System.Diagnostics.Tracing.XplatEventLogger.MinimalJsonserializer"
|
||||
]
|
||||
|
||||
@@ -13,5 +13,6 @@ where
|
||||
|
||||
s2 != "FormatParam" and
|
||||
s2 != "StringOrCharArray" and
|
||||
s2 != "EventSourceActivity"
|
||||
s2 != "EventSourceActivity" and
|
||||
s2 != "EventSourcePrimitive"
|
||||
select s1, s2 order by s1, s2
|
||||
|
||||
Reference in New Issue
Block a user