Expect the optimized dispatch labels from the legacy VB compiler too

This commit is contained in:
dualfroz committed 2026-09-13 21:57:03 +02:00
1 parent d2b048ebb7
commit e0a7ccf651
1 file changed
+7 -7
@@ -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: