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

Fix try/catch/finally il code generation #42

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vCipher
Copy link
Contributor

@vCipher vCipher commented Dec 3, 2018

There is some problem with methods contain try/catch/finally statement.

Pose.Tests.MethodRewriterTests.TestExceptionHandlersRewrite

Test method Pose.Tests.MethodRewriterTests.TestExceptionHandlersRewrite threw exception: 
System.InvalidOperationException: Incorrect code generation for exception block.
   at System.Reflection.Emit.ILGenerator.EndExceptionBlock()
   at Pose.IL.MethodRewriter.EmitILForExceptionHandlers(ILGenerator ilGenerator, Instruction instruction, List`1 handlers)
   at Pose.IL.MethodRewriter.Rewrite()
   at Pose.Tests.MethodRewriterTests.TestExceptionHandlersRewrite()

Wrong exception handler instruction order failed:

  1. begin exception block
  2. begin exception block
  3. begin catch handler
  4. begin finally handler
  5. end catch handler
  6. end finally handler

I have fixed instruction order. Now order is:

  1. begin exception block
  2. begin exception block
  3. begin catch handler
  4. end catch handler
  5. begin finally handler
  6. end finally handler

@jwdonahue
Copy link

Why hasn't this fix been accepted? Is this project dead?

Miista pushed a commit to Miista/pose that referenced this pull request Jan 12, 2024
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.

3 participants