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

Decompilation of inline comparisons into a 'flag' variable done wrong. #17

Closed
itaibh opened this issue Feb 20, 2011 · 2 comments
Closed

Comments

@itaibh
Copy link

itaibh commented Feb 20, 2011

For instance:

for (int current = 0; ; )
{
    bool flag = current < 100; //<----- note this 'flag' variable created automatically by the decompiler
    if (!flag)
    {
        break;
    }
    else
    {
        this.DoSomething();
        current += 1;
    }
}

List<int> list = new List<int>();
list.Add(1);
list.Add(2);
flag = (list == null); //<----- the same 'flag' used again, although not in scope.
if (!flag)
{
    this.DoSomething();
}
@itaibh
Copy link
Author

itaibh commented Feb 21, 2011

In build 364 seems to be OK.

@dgrunwald
Copy link
Member

These flag variables are introduced by the C# compiler (in debug builds only).
The scoping should be fixed starting with build 349; but we'll still have to get rid of those variables, as they prevent the decompiler from detecting the for or foreach patterns correctly.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 11, 2020
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants