Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/TraceEvent/DynamicTraceEventParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,15 @@ private object GetPayloadValueAt(ref PayloadFetch payloadFetch, int offset, int
for (int i = 0; i < arrayCount; i++)
{
object value = GetPayloadValueAt(ref arrayInfo.Element, offset, payloadLength);
if (value.GetType() != elementType)
// Some events have metadata of the form:
// input=Array of ulong
// output=Array of IntPtr
// This is common for bitmasks. To address this, we special case it here.
if (elementType == typeof(IntPtr) && value is ulong uintVal)
{
value = new IntPtr(unchecked((long)uintVal));
}
else if (value.GetType() != elementType)
{
value = ((IConvertible)value).ToType(elementType, null);
}
Expand Down