Red Gate forums :: View topic - foreach nevereding loop issue
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
.NET Reflector 7 EAP
.NET Reflector 7 EAP forum

foreach nevereding loop issue

Search in .NET Reflector 7 EAP forum
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.
Jump to:  
Author Message
alehandro



Joined: 16 Nov 2010
Posts: 35

PostPosted: Sat Jan 29, 2011 11:04 am    Post subject: foreach nevereding loop issue Reply with quote

Hi,
I've found rather tricky case with foreach loop in exported sources.

sometimes C# code (break) is generated normal, eg:

for (int i = 1; i < list2.Count; i++)
{
bool flag = false;
foreach (c0002c7 cc2 in list3)
{
if (cc2.m000222() == list2[i].m000222())
{
flag = true;
goto Label_0132;
}
}
Label_0132:
if (!flag)
{
list3.Add(list2[i]);
}
}


but in some tricky(?) cases it produces really strange (buggy?) construction, eg:

string str4 = string.Empty;
Label_0497:
foreach (string str5 in list)
{
bool flag = false;
foreach (string str6 in strArray)
{
if (string.Compare(str5, str6, true) == 0)
{
goto Label_0497;

}
}
if (!flag)
{
str4 = (str4.Length > 0) ? (str4 + "," + str5) : str5;
}
}

another one:
string str4 = string.Empty;
Label_045D:
foreach (string str5 in list)
{
bool flag = false;
foreach (string str6 in strArray)
{
if (string.Compare(str5, str6, true) == 0)
{
goto Label_045D;

}
}
if (!flag)
{
str4 = (str4.Length > 0) ? (str4 + "," + str5) : str5;
}
}


wow, only now I see that all these cases are 1:1, i.e. the same - but they are from different files!

but there are some others, similar:

Label_047C:
foreach (string str3 in list5)
{
flag3 = false;
foreach (string str4 in strArray)
{
if (string.Compare(str3, str4, true) == 0)
{
goto Label_047C;

}
}
if (!flag3)
{
break;
}
}
if (flag3)
{
list3.Add(cc4);
}

in my understanding instead of that goto after Compare there must be flag = true; break;
Back to top
View user's profile Send private message
Clive Tong



Joined: 04 Dec 2008
Posts: 283

PostPosted: Sun Jan 30, 2011 8:59 am    Post subject: Reply with quote

Hi.

Do you have an example assembly that shows this problem?

Thanks
Back to top
View user's profile Send private message
alehandro



Joined: 16 Nov 2010
Posts: 35

PostPosted: Sun Jan 30, 2011 11:40 am    Post subject: Reply with quote

Sure
/rapidshare.com/files/445278008/uo1.zip
Back to top
View user's profile Send private message
Clive Tong



Joined: 04 Dec 2008
Posts: 283

PostPosted: Mon Jan 31, 2011 10:20 am    Post subject: Reply with quote

Thanks for the example. I've logged it as RP-958.
Back to top
View user's profile Send private message
alehandro



Joined: 16 Nov 2010
Posts: 35

PostPosted: Mon Jan 31, 2011 5:31 pm    Post subject: Reply with quote

Thank you

Tell me please - I see lots of logged IDs, are these to be included in the nearest build? eg - Reflector 7 b2 or Release?
just curious Smile
Back to top
View user's profile Send private message
Clive Tong



Joined: 04 Dec 2008
Posts: 283

PostPosted: Thu Feb 03, 2011 11:00 am    Post subject: Reply with quote

Hi.

Version 7 is fairly locked down at the moment so we'll only be fixing serious bugs.
Back to top
View user's profile Send private message
alehandro



Joined: 16 Nov 2010
Posts: 35

PostPosted: Thu Feb 03, 2011 9:11 pm    Post subject: Reply with quote

Thanks
anyway, please keep doing
The tool is just superB
Back to top
View user's profile Send private message
Display posts from previous:   
This topic is locked: you cannot edit posts or make replies. All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group