Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

goto xxx but xxx doesn't exist #2195

Closed
CreateAndInject opened this issue Oct 21, 2020 · 1 comment
Closed

goto xxx but xxx doesn't exist #2195

CreateAndInject opened this issue Oct 21, 2020 · 1 comment
Labels
Bug Decompiler The decompiler engine itself

Comments

@CreateAndInject
Copy link
Contributor

1.zip

// IntelligentPlanning.ConfigurationStatus.FNGDQM
using System;
using System.Collections.Generic;

public List<string> GetBetsCode(List<OpenData> pDataList, int pIndex)
{
	List<string> result = new List<string>();
	OpenData openData = pDataList[pIndex];
	foreach (KMTM gDQMInfo in GDQMInfoList)
	{
		int num = 0;
		while (num < gDQMInfo.KMTMTypeList.Count)
		{
			int item = Convert.ToInt32(openData.CodeList[gDQMInfo.KMTMTypeList[num]]);
			if (!gDQMInfo.KMTMCodeList.Contains(item))
			{
				num++;
				continue;
			}
			DMLH kMTMValueInfo = gDQMInfo.KMTMValueInfo;
			result = Class0.smethod_71(kMTMValueInfo.NumberList);
			goto end_IL_001a;
		}
	}
	return result;
}
@CreateAndInject CreateAndInject added Bug Decompiler The decompiler engine itself labels Oct 21, 2020
@CreateAndInject
Copy link
Contributor Author

CreateAndInject commented Oct 23, 2020

@siegfriedpammer dnSpy decompile it as a standard for loop without any goto
Is there any improvement you can do?

dnSpy:

public List<string> GetBetsCode(List<ConfigurationStatus.OpenData> pDataList, int pIndex)
{
	List<string> result = new List<string>();
	ConfigurationStatus.OpenData openData = pDataList[pIndex];
	foreach (ConfigurationStatus.KMTM kmtm in this.GDQMInfoList)
	{
		for (int i = 0; i < kmtm.KMTMTypeList.Count; i++)
		{
			int item = Convert.ToInt32(openData.CodeList[kmtm.KMTMTypeList[i]]);
			if (kmtm.KMTMCodeList.Contains(item))
			{
				ConfigurationStatus.DMLH kmtmvalueInfo = kmtm.KMTMValueInfo;
				return Class0.smethod_71(kmtmvalueInfo.NumberList);
			}
		}
	}
	return result;
}

ILSpy

public List<string> GetBetsCode(List<OpenData> pDataList, int pIndex)
{
	List<string> result = new List<string>();
	OpenData openData = pDataList[pIndex];
	foreach (KMTM gDQMInfo in GDQMInfoList)
	{
		int num = 0;
		while (num < gDQMInfo.KMTMTypeList.Count)
		{
			int item = Convert.ToInt32(openData.CodeList[gDQMInfo.KMTMTypeList[num]]);
			if (!gDQMInfo.KMTMCodeList.Contains(item))
			{
				num++;
				continue;
			}
			DMLH kMTMValueInfo = gDQMInfo.KMTMValueInfo;
			result = Class0.smethod_71(kMTMValueInfo.NumberList);
			goto end_IL_001a;
		}
	}
	end_IL_001a:
	return result;
}

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 22, 2021
ElektroKill added a commit to dnSpyEx/ILSpy that referenced this issue Aug 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Decompiler The decompiler engine itself
Projects
None yet
Development

No branches or pull requests

1 participant