diff --git a/ICSharpCode.Decompiler.Tests/TestCases/ILPretty/Issue1047.cs b/ICSharpCode.Decompiler.Tests/TestCases/ILPretty/Issue1047.cs index aa82c2761..3aa1c7c4a 100644 --- a/ICSharpCode.Decompiler.Tests/TestCases/ILPretty/Issue1047.cs +++ b/ICSharpCode.Decompiler.Tests/TestCases/ILPretty/Issue1047.cs @@ -2,23 +2,16 @@ { public class Issue1047 { + private static bool dummy; + private void ProblemMethod() { IL_0000: - do { - if (/*Error near IL_0001: Stack underflow*/ >= /*Error near IL_0001: Stack underflow*/) { - if ((int)/*Error near IL_0007: Stack underflow*/ == 0) { - return; - } - return; - } - } while ((int)/*Error near IL_0014: Stack underflow*/ == 0); - if (/*Error near IL_0020: Stack underflow*/ > /*Error near IL_0020: Stack underflow*/&& (int)/*Error near IL_0026: Stack underflow*/ != 0 && (int)/*Error near IL_002c: Stack underflow*/ == 0) { - return; + while (!Issue1047.dummy) { } return; - IL_0037: + IL_0014: goto IL_0000; } } -} +} \ No newline at end of file diff --git a/ICSharpCode.Decompiler.Tests/TestCases/ILPretty/Issue1047.il b/ICSharpCode.Decompiler.Tests/TestCases/ILPretty/Issue1047.il index 8600ee1bf..7aa9d0dba 100644 --- a/ICSharpCode.Decompiler.Tests/TestCases/ILPretty/Issue1047.il +++ b/ICSharpCode.Decompiler.Tests/TestCases/ILPretty/Issue1047.il @@ -29,44 +29,14 @@ .class public auto ansi beforefieldinit ICSharpCode.Decompiler.Tests.TestCases.ILPretty.Issue1047 { + .field private static bool dummy; .method private hidebysig instance void ProblemMethod() cil managed { - .maxstack 4 - - // loop start - IL_0000: nop - blt IL_0047 - - nop - brfalse IL_0037 - - nop - - IL_0037: nop + IL_0000: ldfld bool ICSharpCode.Decompiler.Tests.TestCases.ILPretty.Issue1047::dummy; + brfalse L_tgt1 br L_exit - - IL_0047: nop - brtrue IL_0083 - - nop - br IL_0000 - - IL_0083: nop - ble.un IL_00fa - - nop - brfalse IL_00db - - nop - brfalse IL_00fa - - IL_00db: nop - - IL_00fa: br L_exit - + L_tgt1: br IL_0000 br IL_0000 - // end loop - L_exit: ret } } \ No newline at end of file