Skip to content

Commit 08c06e6

Browse files
TIHanmatouskozak
authored andcommitted
SPMI: Reset method context 'fileHandle' to the beginning when streaming (dotnet#101523)
1 parent 992a4e6 commit 08c06e6

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/coreclr/tools/superpmi/superpmi-shared/methodcontextreader.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -622,9 +622,13 @@ bool MethodContextReader::IsMethodExcluded(MethodContext* mc)
622622

623623
void MethodContextReader::Reset(const int* newIndexes, int newIndexCount)
624624
{
625-
Indexes = newIndexes;
626-
IndexCount = newIndexCount;
625+
__int64 pos = 0;
626+
BOOL result = SetFilePointerEx(fileHandle, *(PLARGE_INTEGER)&pos, NULL, FILE_BEGIN);
627+
assert(result);
628+
629+
Indexes = newIndexes;
630+
IndexCount = newIndexCount;
627631
curIndexPos = 0;
628-
curMCIndex = 0;
632+
curMCIndex = 0;
629633
curTOCIndex = 0;
630634
}

0 commit comments

Comments
 (0)