CosmosOS / IL2CPU

IL2CPU is a compiler for .NET IL code to compile to assembly language for direct booting.
BSD 3-Clause "New" or "Revised" License
282 stars 70 forks source link

Incorrect sorting in CompilerEngine.cs #143

Closed VasilievSerg closed 2 years ago

VasilievSerg commented 2 years ago

Hello, Looks like the LoadBootEntries method performs invalid ordering.

private void LoadBootEntries()
{

  ....
  mBootEntries = mBootEntries.OrderBy(e => e.Value)
                             .OrderByDescending(e => e.Value.HasValue)
                             .ToDictionary(e => e.Key, e => e.Value);
  ....
}

Most likely, there should be the ThenByDescendinginvocation instead of OrderByDescending. Here is the link.

quajak commented 2 years ago

Thanks, should be fixed by https://github.com/CosmosOS/IL2CPU/pull/144