From e0a7ccf651b1cec4f7d4e504756da48a14b71483 Mon Sep 17 00:00:00 2001 From: DualFroz Date: Sun, 13 Sep 2026 21:57:03 +0200 Subject: [PATCH] Expect the optimized dispatch labels from the legacy VB compiler too --- .../TestCases/VBPretty/Issue3659.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ICSharpCode.Decompiler.Tests/TestCases/VBPretty/Issue3659.cs b/ICSharpCode.Decompiler.Tests/TestCases/VBPretty/Issue3659.cs index 3b9c12d..9f5c35d 100644 --- a/ICSharpCode.Decompiler.Tests/TestCases/VBPretty/Issue3659.cs +++ b/ICSharpCode.Decompiler.Tests/TestCases/VBPretty/Issue3659.cs @@ -15,7 +15,7 @@ public class Issue3659 internal void VBFunction(object value) { -#if OPT +#if OPT || LEGACY_VBC int try0000_dispatch = -1; #else int try0001_dispatch = -1; @@ -27,7 +27,7 @@ public class Issue3659 try { /*Note: ILSpy has introduced the following switch to emulate a goto from catch-block to try-block*/; -#if OPT +#if OPT || LEGACY_VBC switch (try0000_dispatch) #else switch (try0001_dispatch) @@ -39,13 +39,13 @@ public class Issue3659 num2 = 2; Issue3659 obj = this; Func(ref obj, RuntimeHelpers.GetObjectValue(value)); -#if OPT +#if OPT || LEGACY_VBC goto end_IL_0000; #else goto end_IL_0001; #endif } -#if OPT +#if OPT || LEGACY_VBC case 45: #else case 50: @@ -55,7 +55,7 @@ public class Issue3659 { case 2: ShowMessage("VBFunction", 0, "Exception", null, 0); -#if OPT +#if OPT || LEGACY_VBC goto end_IL_0000; #else goto end_IL_0001; @@ -67,7 +67,7 @@ public class Issue3659 catch (Exception ex) when ((num2 != 0) & (num == 0)) { ProjectData.SetProjectError(ex); -#if OPT +#if OPT || LEGACY_VBC try0000_dispatch = 45; #else try0001_dispatch = 50; @@ -76,7 +76,7 @@ public class Issue3659 } throw ProjectData.CreateProjectError(-2146828237); continue; -#if OPT +#if OPT || LEGACY_VBC end_IL_0000: #else end_IL_0001: