<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Jan 21, 2014, at 5:19 , Arthur Yoo <<a href="mailto:phjy007@gmail.com">phjy007@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><p class="MsoNormal">Hi all,</p><p class="MsoNormal"><br></p><p class="MsoNormal"><span style="font-size:10pt">I want to get a FieldRegion when </span><span style="font-size:13px">evaluating a</span><span style="font-size:10pt"> CompoundAssignOperator. The code snippet for my test is like below:</span></p><div><span style="font-size:10pt"> </span><br class="webkit-block-placeholder"></div><p class="MsoNormal"><span style="font-size:10pt">typedef struct {</span></p><p class="MsoNormal"><span style="font-size:10pt"><span style=""> </span>int a;</span></p><p class="MsoNormal"><span style="font-size:10pt"><span style=""> </span>int *p;</span></p><p class="MsoNormal"><span style="font-size:10pt">} Obj;</span></p><p class="MsoNormal"><span style="font-size:10pt">Obj obj;</span></p><p class="MsoNormal"><span style="font-size:10pt">obj.a = 0;</span></p><p class="MsoNormal"><span style="font-size:10pt">obj.a += sizeof(long);</span></p><div><span style="font-size:10pt"> </span><br class="webkit-block-placeholder"></div><div>
<br class="webkit-block-placeholder"></div><p class="MsoNormal"><span style="font-size:10pt">When evaluating the statement
‘<i style="">obj.a += sizeof(long);</i>’ in the
method <i style="">void checkPostStmt(const
BinaryOperator *Op, CheckerContext &C) const</i>, I want to get the
FieldRegion of <i style="">obj.a</i>. But I don’t
know how to get it. Is there anyone can provide me a way to get <i style="">obj.a</i>’s FieldRegion? Thanks a lot.</span></p></div></blockquote></div><br><div>Hi, Arthur. The value of the BinaryOperator's LHS should be an SVal representing the FieldRegion. Are you not seeing that?</div><div><br></div><div>Jordan</div></body></html>