<html><head><meta http-equiv="Content-Type" content="text/html charset=gb18030"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>SVals are values; you can't change them. It'd be like saying x is 2, and now you want to change 2 into 3, when you really want to assign 3 to x.</div><div><br></div><div>What are you actually trying to do here?</div><div>Jordan</div><div><br></div><br><div><div>On Jul 11, 2013, at 3:58 , 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"><br class=""><table cellpadding="0" class="" style="font-family:arial,sans-serif;font-size:14px"><tbody><tr class=""><td class="" style="width:680px"><table cellpadding="0" class="" style="width:680px"><tbody><tr>
<td><div class=""><span name="Jordan Rose" class="" style="font-size:14px">Jordan£º</span></div><div class=""><span name="Jordan Rose" class="" style="font-size:14px"><br></span></div><div class=""><span name="Jordan Rose" class="" style="font-size:14px">It's so kind of you to answer my questions. If I get a SVal variable, how can I modify its value? For an example, I have a SVal. With dump(), it shows '2 S32b'. I want to change its value to 3. So how can I do that? Thank you.</span></div>
<div class=""><span name="Jordan Rose" class="" style="font-size:14px"><br></span></div><div class=""><span name="Jordan Rose" class="" style="font-size:14px">Arthur</span></div></td></tr></tbody></table></td></tr></tbody></table>
<div class="gmail_extra"><br><br><div class="gmail_quote">2013/7/10 Jordan Rose <span dir="ltr"><<a href="mailto:jordan_rose@apple.com" target="_blank">jordan_rose@apple.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word"><div>Hi, Arthur. The Store and Environment are not manipulated directly. Rather, you use the methods of ProgramState to access them.</div><div><br></div><div>...and that said, checkers should hardly ever need to modify the Store and Environment. Most of the time, you should be storing your state in the generic data map (the set<> and get<> methods of ProgramState). Modifying the Environment arbitrarily can break invariants about what does and doesn't have a value. The Store is a little safer¡ªperforming simple bindings and providing default values is usually safe for checkers. Just be careful about types.</div>
<div><br></div><div>The keys in the environment are a tuple of the statement and the location context. The location context is what allows us to handle recursive functions without the callee's bindings stomping on the caller's. We don't have a great way to print a location context, so we just use the pointer value. (Perhaps a stack depth would be helpful?)</div>
<div><br></div><div>Hope that helps,</div><div>Jordan.</div><div><br></div><div>P.S. I can't remember if we've suggested this to you already, but there are some reference materials at <a href="http://clang-analyzer.llvm.org/checker_dev_manual.html" target="_blank">http://clang-analyzer.llvm.org/checker_dev_manual.html</a>. In the first paragraph there's also a link to the talk Anna Zaks and I gave at last year's LLVM Developers' Meeting, which runs through how to build a simple checker and use the generic data map.</div>
<div><br></div><br><div><div><div class="h5"><div>On Jul 8, 2013, at 5:43 , Arthur Yoo <<a href="mailto:phjy007@gmail.com" target="_blank">phjy007@gmail.com</a>> wrote:</div><br></div></div><blockquote type="cite"><div>
<div class="h5"><div dir="ltr">Hi all,
<div><br></div><div><p>I want to get and manipulate the Store and Environment in
the current ProgramState in checkPreStmt() and checkPostStmt(). How can I do
that? </p><p>What's more, I¡¯ve dumped the ProgramState in my checker in checkPostStmt(). But I don¡¯t know
the meaning of addresses in the Expressions. What do those addresses mean? Thanks a
lot. <span style="white-space:pre-wrap">Any help will be greatly appreciated.</span></p><p><span style="white-space:pre-wrap"><br></span></p><pre style="white-space:pre-wrap">Best regards,
Arthur Yoo</pre><div><br></div>
</div></div></div></div>
_______________________________________________<br>cfe-dev mailing list<br><a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">cfe-dev@cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</blockquote></div><br></div></blockquote></div><br>
</div></div>
</blockquote></div><br></body></html>