dotnet / corert

This repo contains CoreRT, an experimental .NET Core runtime optimized for AOT (ahead of time compilation) scenarios, with the accompanying compiler toolchain.

Home Page:http://dot.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wasm: execution sequence of finally and filters is wrong

yowl opened this issue · comments

commented

Wasm exception handling, where filters are in in higher catches, is processing the filters after finallys . This means that this test fails in Wasm: https://stackoverflow.com/questions/57544142/in-c-sharp-try-finally-how-to-catch-the-original-exception/57544409#57544409

This is because Wasm is using a mix of manual handling and leveraging LLVM exceptions. A possible fix could be to store finally blocks (along with the shadow stack pointers) while the filters are evaluated going back up the stack and only execute them once a catch has been found.

Running finally blocks when the exception is not caught anywhere is another case to consider and probably broken currently as well.