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

Error dissasembling when handling exceptions #10

Open
rcastano opened this issue Jul 13, 2018 · 3 comments
Open

Error dissasembling when handling exceptions #10

rcastano opened this issue Jul 13, 2018 · 3 comments
Assignees
Labels

Comments

@rcastano
Copy link

The following code throws an exception.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

class Ex1 : Exception
{

}
class Ex2 : Exception
{

}
class TestExceptionsWhen
{
    public void Main(int y)
    {
        int x = 5;
        try
        {
            x = x / y;
        }
        catch (Exception ex) when (ex is Ex1 || ex is Ex2)
        {

        }
    }
}
@m-carrasco
Copy link

The exception is also thrown in advance-pta using Analysis-Explorer.

@garbervetsky
Copy link

@edgardozoppi This is a first attempt fix the problem. It's in my fork.

garbervetsky@0027733

Probably is just a partial solution. I created two handles: one for the filter and its catch block but I treat Filters as Catch blocks (that has to be fixed)

@rcastano
Copy link
Author

There seems to be a type error too in the TAC produced for this code:

  L_0027:  $s0 = $s0 > $s1;
  L_0029:  goto L_002C;
  L_002B:  $s0 = 1;
  L_002C:  local_2 = $s0;
  L_002D:  $s0 = local_2;
  L_002E:  $s1 = 0;
  L_002F:  $s0 = $s0 > $s1;

I'm not sure what the underlying cause is but I wasn't able to reproduce the problem with a simpler code snippet (such as without using the 'when' keyword).

Please confirm whether you're able to reproduce this issue and whether to file it as a separate issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants