diff --git a/Tests/Kernels/Cosmos.Compiler.Tests.MethodTests/Kernel.cs b/Tests/Kernels/Cosmos.Compiler.Tests.MethodTests/Kernel.cs index 1497be2b3..6d2955685 100644 --- a/Tests/Kernels/Cosmos.Compiler.Tests.MethodTests/Kernel.cs +++ b/Tests/Kernels/Cosmos.Compiler.Tests.MethodTests/Kernel.cs @@ -12,9 +12,34 @@ namespace Cosmos.Compiler.Tests.MethodTests { Console.WriteLine("Cosmos booted successfully. Type a line of text to get it echoed back."); } + public static void BranchStackCorruption2() + { + char c = 'l'; + char c2 = (c <= 'Z' && c >= 'A') ? ((char)(c - 65 + 97)) : c; + c = 'L'; + char c3 = (c <= 'Z' && c >= 'A') ? ((char)(c - 65 + 97)) : c; + } + + public static void BranchStackCorruption() + { + bool flag1 = true; + bool flag2 = false; + bool flag3 = true; + + if (flag1 && (flag2 || flag3)) + { + return; + } + else + { + throw new Exception("This should not occur"); + } + } protected override void Run() { + BranchStackCorruption(); + BranchStackCorruption2(); try { ReturnTests.Execute();