<div dir="ltr">
<p class="">Hi Anna, </p>
<p class="">Thank you and Jordan for your reply to answer my questions. Now I can understand the execution path sequence of ex3. However, it seems that I met another problem with loop execution path. <br></p>
<p class="">Here is my test code ex4:<br></p>
<p class=""> 1 void func(int arg) {</p>
<p class=""> 2 int v;</p>
<p class=""> 3 v = 0;</p>
<p class=""> 4 int i;</p>
<p class=""> 5 for(int i = 0; i < arg; i++) {</p>
<p class=""> 6 v = v + 1; </p>
<p class=""> 7 }</p>
<p class=""> 8 </p>
<p class=""> 9 if(arg < 0) {</p>
<p class=""> 10 v = 5566;</p>
<p class=""> 11 }</p>
<p class=""> 12 </p>
<p class=""> 13 int c;</p>
<p class=""> 14 c = v;</p>
<p class=""> 15 }</p>
<p class="">The corresponding CFG of ex4 is <a href="http://ww3.sinaimg.cn/large/a74ecc4cjw1e3kuhrthqij.jpg">http://ww3.sinaimg.cn/large/a74ecc4cjw1e3kuhrthqij.jpg</a></p>
<p class="">With analyzer, I get its execution path sequence: B7-B6-B3-B1-B2-B1-B5-B4-B6-B3-B1-B5-B4-B6-B3-B1-B5-B4-B6-B3-B1-B5-B4. It shows that the analyzer traces all possible paths in its CFG since arg(in line 5) is a symbolic value. Analyzer has no idea about whether arg is greater than zero. </p>
<p class="">Then I replaced the arg in line 5 with a concrete number(say 64, actually any number which is greater than three). <br></p>
<p class="">for(int i = 0; i < arg; i++) --> for(int i = 0; i < 64; i++)</p>
<p class="">Then the analyzer gave me the following execution path sequence: B7-B6-B5-B4-B6-B5-B4-B6-B5-B4-B6-B5-B4.</p>
<p class="">It is right that the loop has been executed for four time, but it seems that the analyzer didn't </p>
<p class="">cover all possible paths. In other words, it means that the analyzer didn't analyze the range from line 9 to line 14 in ex4's source code. I can't find the corresponding CFG blocks which represent the part of source code from line 9 to line 14 of ex4 in this execution path sequence. </p>
<p class="">In addition, I did another four tests. In these four tests, I replaced the loop condition with 0, 1, 2 and 3 for each time. The corresponding execution path sequences are below.</p><p class="">for(int i = 0; i < 3; i++): B7-B6-B5-B4-B6-B5-B4-B6-B5-B4-B6-B3-B1-B2-B1</p>
<p class="">for(int i = 0; i < 2; i++):<span class=""> </span>B7-B6-B5-B4-B6-B5-B4-B6-B3-B1-B2-B1</p>
<p class="">for(int i = 0; i < 1; i++):<span class=""> </span>B7-B6-B5-B4-B6-B3-B1-B2-B1</p>
<p class="">for(int i = 0; i < 0; i++):<span class=""> </span>B7-B6-B3-B1-B2-B1</p>
<p class="">With these four execution path sequences above, I can get the conclusion that for these four cases, the analyzer analyzed the whole ex4 source code and traced all possible paths in ex4. </p>
<p class="">So I don't know why the analyzer didn't analyze the range from line 9 to line 14 in ex4's source code when the loop time is more or equal to 4?</p><div class="gmail_extra"><br><br><div class="gmail_quote">
<div class="gmail_extra" style="font-family:arial,sans-serif;font-size:14px">Best regards,</div><div class="gmail_extra" style="font-family:arial,sans-serif;font-size:14px">Arthur Yoo</div></div></div></div>