Skip to content

Continue statement unrecognized in try-catch #2829

Description

@sgkoishi

Input code

https://sharplab.io/#gist:ca290c8cdd39ae90d27894091c5ee33a
Loop over array:

foreach (...) // or for (...)
{
	try
	{
		// Action
	}
	catch (..)
	{
		continue;
	}
	// Action 2
}

Loop over Iterator:
https://github.com/Pryaxis/TSAPI/blob/general-devel/TerrariaServerAPI/TerrariaApi.Server/ServerApi.cs#L348

Erroneous output

foreach (...) // or for (...)
{
	try
	{
		// Action
	}
	catch (..)
	{
		goto IL_TAG;
	}
	// Action 2
	IL_TAG:
	;
}

Details

  • Product in use: ILSpy
  • Version in use: 8.0.0.7136-preview2

Nothing wrong with the actual behaviour but just improvement.

The loop over iterator example binary is available through NuGet or zip, bin/TerrariaServer.dll. Some continue were recognized but the one within BadImageFormatException was not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugDecompilerThe decompiler engine itself

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions