Skip to content

Commit 7b5699d

Browse files
committed
C#: Update CIL attributes test
1 parent 2fe6512 commit 7b5699d

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

csharp/ql/test/library-tests/cil/attributes/attribute.expected

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ attrNoArg
1111
| Interop.Sys.FileStatusFlags | [FlagsAttribute(...)] |
1212
| Interop.Sys.OpenFlags | [FlagsAttribute(...)] |
1313
| Interop.Sys.Permissions | [FlagsAttribute(...)] |
14-
| Interop.libproc.proc_bsdinfo.<pbi_comm>e__FixedBuffer | [CompilerGeneratedAttribute(...)] |
15-
| Interop.libproc.proc_bsdinfo.<pbi_comm>e__FixedBuffer | [UnsafeValueTypeAttribute(...)] |
16-
| Interop.libproc.proc_bsdinfo.<pbi_name>e__FixedBuffer | [CompilerGeneratedAttribute(...)] |
17-
| Interop.libproc.proc_bsdinfo.<pbi_name>e__FixedBuffer | [UnsafeValueTypeAttribute(...)] |
1814
| InteropErrorExtensions | [ExtensionAttribute(...)] |
1915
| Microsoft.CodeAnalysis.EmbeddedAttribute | [CompilerGeneratedAttribute(...)] |
2016
| Microsoft.CodeAnalysis.EmbeddedAttribute | [EmbeddedAttribute(...)] |
@@ -808,8 +804,6 @@ attrNoArg
808804
| System.Threading.AsyncLocalValueChangedArgs`1.<PreviousValue>k__BackingField | [CompilerGeneratedAttribute(...)] |
809805
| System.Threading.AsyncLocalValueChangedArgs`1.<ThreadContextChanged>k__BackingField | [CompilerGeneratedAttribute(...)] |
810806
| System.Threading.AsyncLocalValueMap.<Empty>k__BackingField | [CompilerGeneratedAttribute(...)] |
811-
| System.Threading.AutoreleasePool.<EnableAutoreleasePool>k__BackingField | [CompilerGeneratedAttribute(...)] |
812-
| System.Threading.AutoreleasePool.s_AutoreleasePoolInstance | [ThreadStaticAttribute(...)] |
813807
| System.Threading.CancellationToken | [IsReadOnlyAttribute(...)] |
814808
| System.Threading.CancellationToken.<>c | [CompilerGeneratedAttribute(...)] |
815809
| System.Threading.CancellationTokenRegistration | [IsReadOnlyAttribute(...)] |
@@ -1452,10 +1446,6 @@ attrArgPositional
14521446
| Internal.Runtime.InteropServices.IClassFactory | [InterfaceTypeAttribute(...)] | 0 | 1 |
14531447
| Internal.Runtime.InteropServices.IClassFactory | [NullableContextAttribute(...)] | 0 | 2 |
14541448
| Interop.Sys.MountPointFound | [UnmanagedFunctionPointerAttribute(...)] | 0 | 2 |
1455-
| Interop.libproc.proc_bsdinfo.pbi_comm | [FixedBufferAttribute(...)] | 0 | System.Byte |
1456-
| Interop.libproc.proc_bsdinfo.pbi_comm | [FixedBufferAttribute(...)] | 1 | 16 |
1457-
| Interop.libproc.proc_bsdinfo.pbi_name | [FixedBufferAttribute(...)] | 0 | System.Byte |
1458-
| Interop.libproc.proc_bsdinfo.pbi_name | [FixedBufferAttribute(...)] | 1 | 32 |
14591449
| Microsoft.Win32.SafeHandles.SafeFileHandle | [NullableAttribute(...)] | 0 | 0 |
14601450
| Microsoft.Win32.SafeHandles.SafeFileHandle | [NullableContextAttribute(...)] | 0 | 2 |
14611451
| Microsoft.Win32.SafeHandles.SafeWaitHandle System.Threading.RegisteredWaitHandle.UserUnregisterWaitHandle | [NullableAttribute(...)] | 0 | 2 |

csharp/ql/test/library-tests/cil/attributes/attribute.ql

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
import semmle.code.cil.Attribute
22
import semmle.code.cil.Declaration
33

4-
private predicate isOsSpecific(Declaration d) { d.getQualifiedName().matches("%libobjc%") }
4+
private predicate isOsSpecific(Declaration d) {
5+
d.getQualifiedName()
6+
.matches("%" +
7+
[
8+
"libobjc", "libproc", "System.Diagnostics.Tracing.XplatEventLogger",
9+
"System.Threading.AutoreleasePool"
10+
] + "%")
11+
}
512

613
query predicate attrNoArg(string dec, string attr) {
714
exists(Declaration d, Attribute a |

0 commit comments

Comments
 (0)