Skip to content

Commit

Permalink
add another assert
Browse files Browse the repository at this point in the history
  • Loading branch information
davmason committed May 27, 2020
1 parent ac606c7 commit bf92139
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/TraceEvent/EventPipe/EventPipeEventSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ void ReadEventHeader(byte* headerPtr, bool useHeaderCompression, ref EventPipeEv
ParseEventParameters(eventTemplate, metaDataHeader, reader, metaDataEnd, NetTraceFieldLayoutVersion.V1);
}

while (reader.Current != metaDataEnd)
while (reader.Current < metaDataEnd)
{
// If we've already parsed the V1 metadata and there's more left to decode,
// then we have some tags to read
Expand All @@ -293,6 +293,8 @@ void ReadEventHeader(byte* headerPtr, bool useHeaderCompression, ref EventPipeEv
reader.Goto(tagEndLabel);
}

Debug.Assert(reader.Current == metaDataEnd);

_eventMetadataDictionary.Add(metaDataHeader.MetaDataId, metaDataHeader);
_metadataTemplates[eventTemplate] = eventTemplate;

Expand Down

0 comments on commit bf92139

Please sign in to comment.