using System; using Microsoft.VisualBasic.CompilerServices; namespace ICSharpCode.Decompiler.Tests.TestCases.ILPretty { public class Issue3659 { public static void Func(ref Issue3659 obj, object value) { } public static int ShowMessage(string a, int b, string c, object d, int e) { return 0; } internal void VBFunction(object value) { int try0000_dispatch = -1; int num2 = default; int num = default; while (true) { try { /*Note: ILSpy has introduced the following switch to emulate a goto from catch-block to try-block*/; switch (try0000_dispatch) { default: { ProjectData.ClearProjectError(); num2 = 2; Issue3659 obj = this; Func(ref obj, value); goto end_IL_0000; } case 40: num = -1; switch (num2) { case 2: ShowMessage("VBFunction", 0, "Exception", null, 0); goto end_IL_0000; } break; } } catch (Exception ex) when ((num2 != 0) & (num == 0)) { ProjectData.SetProjectError(ex); try0000_dispatch = 40; continue; } throw ProjectData.CreateProjectError(-214628237); continue; end_IL_0000: break; } if (num != 0) { ProjectData.ClearProjectError(); } } } }