Fix GetCustomAttribute API for DllImportAttribute pseudo custom attribute
authorJan Kotas <jkotas@microsoft.com>
Sun, 25 Feb 2018 20:06:05 +0000 (12:06 -0800)
committerJan Kotas <jkotas@microsoft.com>
Mon, 26 Feb 2018 04:01:09 +0000 (20:01 -0800)
commit41067e5d218a44fa96616c1b56f0cb71d752d5e9
treec68cb521e1621e716b7bf1ef51259518d2ae96ab
parent9b84b4861349a7b1d3ccf20a9ffb95b619b6c12f
Fix GetCustomAttribute API for DllImportAttribute pseudo custom attribute

GetCustomAttribute for DllImportAttribute was throwing IndexOutOfRangeException. It made XUnit skip the rest of test methods after encoutering DllImport method in the test type.

It is regression introduced by https://github.com/dotnet/coreclr/pull/13870

Fixes https://github.com/dotnet/corefx/issues/27426
src/mscorlib/src/System/Reflection/CustomAttribute.cs