| Author |
Message |
alehandro
Joined: 16 Nov 2010 Posts: 35
|
Posted: Sat Jan 29, 2011 11:04 am Post subject: foreach nevereding loop issue |
|
|
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 |
|
 |
Clive Tong
Joined: 04 Dec 2008 Posts: 281
|
Posted: Sun Jan 30, 2011 8:59 am Post subject: |
|
|
Hi.
Do you have an example assembly that shows this problem?
Thanks |
|
| Back to top |
|
 |
alehandro
Joined: 16 Nov 2010 Posts: 35
|
Posted: Sun Jan 30, 2011 11:40 am Post subject: |
|
|
Sure
/rapidshare.com/files/445278008/uo1.zip |
|
| Back to top |
|
 |
Clive Tong
Joined: 04 Dec 2008 Posts: 281
|
Posted: Mon Jan 31, 2011 10:20 am Post subject: |
|
|
| Thanks for the example. I've logged it as RP-958. |
|
| Back to top |
|
 |
alehandro
Joined: 16 Nov 2010 Posts: 35
|
Posted: Mon Jan 31, 2011 5:31 pm Post subject: |
|
|
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  |
|
| Back to top |
|
 |
Clive Tong
Joined: 04 Dec 2008 Posts: 281
|
Posted: Thu Feb 03, 2011 11:00 am Post subject: |
|
|
Hi.
Version 7 is fairly locked down at the moment so we'll only be fixing serious bugs. |
|
| Back to top |
|
 |
alehandro
Joined: 16 Nov 2010 Posts: 35
|
Posted: Thu Feb 03, 2011 9:11 pm Post subject: |
|
|
Thanks
anyway, please keep doing
The tool is just superB |
|
| Back to top |
|
 |
|