Skip to content

Conversation

@yowl
Copy link
Contributor

@yowl yowl commented Sep 14, 2022

This PR fixes a couple of issues with the LLVM IL backend for exception handling. The second pass handler is now called before the catch (oops), and the finally block when adjacent to a catch, is only now called once.

I expect there are other problems, but at least this fixes 2 big ones and allows

finally
{
cctors[cctorIndex].HoldingThread = ManagedThreadIdNone;
NoisyLog("Releasing cctor lock, cctor={0}, thread={1}", pfnCctor, currentManagedThreadId);
cctorLock.Release();
}

to throw without dying in the Release

Long term wasm-exceptions may help depending on how close the semantics are to .net I guess.

cc @SingleAccretion

@yowl
Copy link
Contributor Author

yowl commented Sep 14, 2022

closes #1990

@jkotas
Copy link
Member

jkotas commented Sep 14, 2022

I think you will need to port everything in dotnet/runtime#75294 to fix the macOS build failures.

@yowl
Copy link
Contributor Author

yowl commented Sep 14, 2022

I think you will need to port everything in dotnet/runtime#75294 to fix the macOS build failures.

Thanks I was having a bit of a problem

else
{
tryRegionIdx = 0;
tryRegionIdx = MaxTryRegionIdx;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed? We have set tryRegionIdx = MaxTryRegionIdx; before the loop.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, deleted. Thanks

@jkotas jkotas merged commit a1d198e into dotnet:feature/NativeAOT-LLVM Sep 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants