From 508870822362ee0d7f46c4df92326e779ed52be5 Mon Sep 17 00:00:00 2001 From: upstream Date: Sun, 13 Sep 2026 18:32:51 +0200 Subject: [PATCH] Upstream icsharpcode/ILSpy state of the touched files before 39c6f5eada --- .../TestCases/VBPretty/Issue3659.cs | 91 ------------------- .../TestCases/VBPretty/Issue3659.vb | 17 ---- .../VBPrettyTestRunner.cs | 6 -- 3 files changed, 114 deletions(-) delete mode 100644 ICSharpCode.Decompiler.Tests/TestCases/VBPretty/Issue3659.cs delete mode 100644 ICSharpCode.Decompiler.Tests/TestCases/VBPretty/Issue3659.vb diff --git a/ICSharpCode.Decompiler.Tests/TestCases/VBPretty/Issue3659.cs b/ICSharpCode.Decompiler.Tests/TestCases/VBPretty/Issue3659.cs deleted file mode 100644 index 9f5c35d..0000000 --- a/ICSharpCode.Decompiler.Tests/TestCases/VBPretty/Issue3659.cs +++ /dev/null @@ -1,91 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using Microsoft.VisualBasic.CompilerServices; - -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) - { -#if OPT || LEGACY_VBC - int try0000_dispatch = -1; -#else - int try0001_dispatch = -1; -#endif - 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*/; -#if OPT || LEGACY_VBC - switch (try0000_dispatch) -#else - switch (try0001_dispatch) -#endif - { - default: - { - ProjectData.ClearProjectError(); - num2 = 2; - Issue3659 obj = this; - Func(ref obj, RuntimeHelpers.GetObjectValue(value)); -#if OPT || LEGACY_VBC - goto end_IL_0000; -#else - goto end_IL_0001; -#endif - } -#if OPT || LEGACY_VBC - case 45: -#else - case 50: -#endif - num = -1; - switch (num2) - { - case 2: - ShowMessage("VBFunction", 0, "Exception", null, 0); -#if OPT || LEGACY_VBC - goto end_IL_0000; -#else - goto end_IL_0001; -#endif - } - break; - } - } - catch (Exception ex) when ((num2 != 0) & (num == 0)) - { - ProjectData.SetProjectError(ex); -#if OPT || LEGACY_VBC - try0000_dispatch = 45; -#else - try0001_dispatch = 50; -#endif - continue; - } - throw ProjectData.CreateProjectError(-2146828237); - continue; -#if OPT || LEGACY_VBC - end_IL_0000: -#else - end_IL_0001: -#endif - break; - } - if (num != 0) - { - ProjectData.ClearProjectError(); - } - } -} diff --git a/ICSharpCode.Decompiler.Tests/TestCases/VBPretty/Issue3659.vb b/ICSharpCode.Decompiler.Tests/TestCases/VBPretty/Issue3659.vb deleted file mode 100644 index 1575fdd..0000000 --- a/ICSharpCode.Decompiler.Tests/TestCases/VBPretty/Issue3659.vb +++ /dev/null @@ -1,17 +0,0 @@ -Imports System -Public Class Issue3659 - Public Shared Sub Func(ByRef obj As Issue3659, value As Object) - End Sub - - Public Shared Function ShowMessage(a As String, b As Integer, c As String, d As Object, e As Integer) As Integer - Return 0 - End Function - - Friend Sub VBFunction(value As Object) - On Error GoTo Handler - Func(Me, value) - Exit Sub -Handler: - ShowMessage("VBFunction", 0, "Exception", Nothing, 0) - End Sub -End Class diff --git a/ICSharpCode.Decompiler.Tests/VBPrettyTestRunner.cs b/ICSharpCode.Decompiler.Tests/VBPrettyTestRunner.cs index f608cca..a700d4e 100644 --- a/ICSharpCode.Decompiler.Tests/VBPrettyTestRunner.cs +++ b/ICSharpCode.Decompiler.Tests/VBPrettyTestRunner.cs @@ -132,12 +132,6 @@ namespace ICSharpCode.Decompiler.Tests await Run(options: options | CompilerOptions.Library); } - [Test] - public async Task Issue3659([ValueSource(nameof(defaultOptions))] CompilerOptions options) - { - await Run(options: options | CompilerOptions.Library); - } - [Test] public async Task Issue1906([ValueSource(nameof(defaultOptions))] CompilerOptions options) {