From 4ffeeae27897442ea37eebb3b0d3b8779fc8a69a Mon Sep 17 00:00:00 2001 From: Matthijs ter Woord Date: Fri, 6 Nov 2015 09:03:00 +0100 Subject: [PATCH] Compiler bug fixed. --- .../DefaultEngineConfiguration.cs | 14 +++++++------- source/Cosmos.IL2CPU/ILOpCodes/OpNone.cs | 8 ++++++++ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/Tests/Cosmos.TestRunner.Core/DefaultEngineConfiguration.cs b/Tests/Cosmos.TestRunner.Core/DefaultEngineConfiguration.cs index 78d131da9..a8692ccbe 100644 --- a/Tests/Cosmos.TestRunner.Core/DefaultEngineConfiguration.cs +++ b/Tests/Cosmos.TestRunner.Core/DefaultEngineConfiguration.cs @@ -21,23 +21,23 @@ namespace Cosmos.TestRunner.Core // If you're working on the compiler (or other lower parts), you can choose to run the compiler in process // one thing to keep in mind though, is that this only works with 1 kernel at a time! - engine.RunIL2CPUInProcess = true; + //engine.RunIL2CPUInProcess = true; engine.EnableStackCorruptionChecks = true; //engine.RunWithGDB = true; // Select kernels to be tested by adding them to the engine - //engine.AddKernel(typeof(Cosmos.Compiler.Tests.Bcl.Kernel).Assembly.Location); - //engine.AddKernel(typeof(Cosmos.Compiler.Tests.SingleEchoTest.Kernel).Assembly.Location); - //engine.AddKernel(typeof(Cosmos.Compiler.Tests.SimpleWriteLine.Kernel.Kernel).Assembly.Location); - //engine.AddKernel(typeof(SimpleStructsAndArraysTest.Kernel).Assembly.Location); - //engine.AddKernel(typeof(VGACompilerCrash.Kernel).Assembly.Location); + engine.AddKernel(typeof(Cosmos.Compiler.Tests.Bcl.Kernel).Assembly.Location); + engine.AddKernel(typeof(Cosmos.Compiler.Tests.SingleEchoTest.Kernel).Assembly.Location); + engine.AddKernel(typeof(Cosmos.Compiler.Tests.SimpleWriteLine.Kernel.Kernel).Assembly.Location); + engine.AddKernel(typeof(SimpleStructsAndArraysTest.Kernel).Assembly.Location); + engine.AddKernel(typeof(VGACompilerCrash.Kernel).Assembly.Location); // Known bugs, therefore disabled for now: //engine.AddKernel(typeof(BoxingTests.Kernel).Assembly.Location); // Experimental stuff: - engine.AddKernel(typeof(Cosmos.Kernel.Tests.Fat.Kernel).Assembly.Location); + //engine.AddKernel(typeof(Cosmos.Kernel.Tests.Fat.Kernel).Assembly.Location); // end of known bugs diff --git a/source/Cosmos.IL2CPU/ILOpCodes/OpNone.cs b/source/Cosmos.IL2CPU/ILOpCodes/OpNone.cs index addb3a8f8..55c83fe60 100644 --- a/source/Cosmos.IL2CPU/ILOpCodes/OpNone.cs +++ b/source/Cosmos.IL2CPU/ILOpCodes/OpNone.cs @@ -673,6 +673,14 @@ namespace Cosmos.IL2CPU.ILOpCodes { return; } if (StackPopTypes[0] == typeof(int) && StackPopTypes[1] == typeof(int)) + { + StackPushTypes[0] = typeof(int); + aSituationChanged = true; + return; + } + if ((StackPopTypes[0] == typeof(int) && StackPopTypes[1] == typeof(bool)) + || (StackPopTypes[0] == typeof(bool) && StackPopTypes[1] == typeof(int))) + { StackPushTypes[0] = typeof(int); aSituationChanged = true;