I've 'fixed' #1764 by changing _.MatchLdcI(1)
to _.MatchLdcI(1) || _.MatchLdcF4(1) || _.MatchLdcF8(1)
in 3 places.
Test cases are passing fine (except for Cecil which has always had path issues). Am I overlooking something obvious or is this a simple fix?
byte*
/sbyte*
.
paraphrasing the ILAst of the obfuscated code, before "Duplicate block exit" + "Extract else block" the control flow looks like this:
if (...) {
call Something()
} else {
while (true) {
if (...)
return;
}
}
return;
and after it looks like this:
if (...) {
call Something()
return;
}
while (true) {
if (...)
return;
}
return;
public void Issue1524V3(string str)
{
if (!string.IsNullOrEmpty(str))
{
return;
}
if (int.TryParse(str, out int id))
{
Console.WriteLine(new Func<int>(() => id));
}
}
public void Issue1524V4(string str)
{
if (string.IsNullOrEmpty(str))
{
if (int.TryParse(str, out int id))
{
Console.WriteLine(new Func<int>(() => id));
}
}
}
stloc V_1(newobj <>c__DisplayClass10_0..ctor())
is before the first if
TransformDisplayClassUsage
removes the display class init and store, but it runs after ConditionDetection
ConditionDetection
(or a part of it) againAssemblyResolver.AddSearchDirectory
?