DataObjects-NET / dataobjects-net

https://dataobjects.net
MIT License
60 stars 23 forks source link

Weaver: Fixes broken catch leaving to final ret operation #295

Closed alex-kulakov closed 1 year ago

alex-kulakov commented 1 year ago

There are broken leave.s operations in entity constructors with bodies like below

  public SomeEntity(Session session) : base(session)
  {
    try
    {
      this.DoThis();
    }
    catch (Exception ex)
    {
      this.DoSomethingElse();
      return;
    }
    this.DoAFinalThing();
  }

This PR gets last ret operation (if it exists) and changes leave.s operation's target instruction (if it exists) in catch part to correct instruction that added by Weaver