Skip to content

Invalid exception handler execution flow #918

Open
@aromaa

Description

@aromaa

Details about Problem

Target: ESP32-WROOM-32

Firmware image version: 1.7.3-preview.67

Description

Exception flow is not correctly handled inside finally block when another method catches exception. This also required branching inside the try block so this is some weird edge case here. From the following code we can observe that the program prints out "Impossible!?!" even though the code is unreachable.

try
{
	static bool False() => false;

	if (!False())
	{
		Debug.WriteLine("Return!");

		return;
	}
}
finally
{
	Throw();

	static void Throw()
	{
		try
		{
			throw new Exception();
		}
		catch
		{
		}
	}
}

Debug.WriteLine("Impossible!?!");

Thread.Sleep(Timeout.Infinite);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions