DefinitionInstruction并不总是有效 [英] DefinitionInstruction not always working

查看:106
本文介绍了DefinitionInstruction并不总是有效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我一直试图通过分析包含所述循环的MSIL二进制文件来检测数组循环中的迭代次数。这是我一直试图分析的来源:

I've been trying to detect the number of iterations in loops over an array by analyzing MSIL binaries containing said loops. Here's the source I've been trying to analyze:

















public static < font style ="font-size:11px"> void TestArray()
{
int size = 15;
int [] test = new int [size];
for int i = 12; i< = 89; + + I);
}
public static void TestArray()  
{  
    int size = 15;  
    int[] test = new int[size];  
    for (int i = 12; i <= 89; ++i) ;  

推荐答案

DefinitionInstruction仅适用于SSA中的操作数,或者是表达式临时值。 tv291-既不是。我们有不同的SSA风格(在SSA结构的参数中指定)。您似乎已经使用了"unaliased"消息。 flavor(有时称为NotAliasedScalars),它在SSA图中不包含别名变量。切换到"别名" SSA将在SSA中包含tv291-。
DefinitionInstruction only works for operands that are in SSA, or are expression temporaries.  tv291- is neither.  We have different flavors of SSA (specified in arguments to the SSA construction).  It appears that you have used the "unaliased" flavor (sometimes referred to as NotAliasedScalars), which does not include aliased variables in the SSA graph.  Switching to "aliased" SSA would include tv291- in SSA.


这篇关于DefinitionInstruction并不总是有效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆