Skip to content

Commit d81df87

Browse files
committed
[MERGE chakra-core#4442 @MikeHolman] fix infinite loop in ProcessContext registration
Merge pull request chakra-core#4442 from MikeHolman:contextremoval
2 parents c706978 + 3e105e7 commit d81df87

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

lib/JITServer/JITServer.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -885,8 +885,7 @@ HRESULT
885885
ProcessContextManager::RegisterNewProcess(DWORD pid, HANDLE processHandle, intptr_t chakraBaseAddress, intptr_t crtBaseAddress)
886886
{
887887
AutoCriticalSection autoCS(&cs);
888-
auto iter = ProcessContexts.GetIteratorWithRemovalSupport();
889-
while (iter.IsValid())
888+
for (auto iter = ProcessContexts.GetIteratorWithRemovalSupport(); iter.IsValid(); iter.MoveNext())
890889
{
891890
ProcessContext* context = iter.CurrentValue();
892891
// We can delete a ProcessContext if no ThreadContexts refer to it and the process is terminated

0 commit comments

Comments
 (0)