<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>That sounds right. Let me know if you have any more questions!</div><div><br></div><div>Jordan</div><br><div><div>On Dec 12, 2013, at 7:17 , Zach Davis <<a href="mailto:zdavkeos@gmail.com">zdavkeos@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">Let me see if I understand the plan:<br><br>1. Add a runCheckersForPreStmt() call to ExprEngine::processBranch<br>right after the call to runCheckersForBranchStmt(), effectively<br>chaining the two together.  The loop can the evaluate the nodes<br>

returned from both calls?<br><br>2. Add a runCheckersForPreStmt() call to the top of<br>ExprEngine::processSwitch.  The loop will then need to evaluate the<br>returned nodes as well as explore and evaluate the switch body as it<br>

currently does?<br><br>3. Add a runCheckersForPreStmt() call to<br>ExprEngine::processIndirectGoto and add a loop to evaluate any<br>returned nodes.<br><br>Zach<br><br>> Hi, Zach. That's great to hear. The code lives in ExprEngine.cpp, and<br>

> you can see in functions like ExprEngine::VisitUnaryOperator<br>> (ExprEngineC.cpp) that it basically just consists of a call to the<br>> CheckerManager to run the pre-statement checks, then a loop over the<br>

> results to actually perform the evaluation. In<br>> ExprEngine::processBranch the loop is already in place, so you just<br>> need to add the second callback; ExprEngine::processSwitch also has a<br>> loop but may need a bit more<br>

> restructuring. ExprEngine::processIndirectGoto is the last of these<br>> and probably needs a completely new loop added.<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Dec 11, 2013 at 12:08 PM, Jordan Rose <span dir="ltr"><<a href="mailto:jordan_rose@apple.com" target="_blank">jordan_rose@apple.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><br>
On Dec 6, 2013, at 10:07 , Zach Davis <<a href="mailto:zdavkeos@gmail.com">zdavkeos@gmail.com</a>> wrote:<br>
<br>
> > Right; what I meant was that we'd prefer to make this work rather than adding switch statements to checkBranchCondition, but right now neither one works. Sorry for the inconvenience.<br>
> ><br>
> > Jordan<br>
><br>
> I had this same problem and ended up using an ast-matcher in a clang tool instead to get the information I wanted.<br>
><br>
> I would be interested in helping add this feature though.<br>
><br>
><br>
> I found the bug report (18175), but could use some pointers to get started on a patch.<br>
<br>
</div></div>Hi, Zach. That's great to hear. The code lives in ExprEngine.cpp, and you can see in functions like ExprEngine::VisitUnaryOperator (ExprEngineC.cpp) that it basically just consists of a call to the CheckerManager to run the pre-statement checks, then a loop over the results to actually perform the evaluation. In ExprEngine::processBranch the loop is already in place, so you just need to add the second callback; ExprEngine::processSwitch also has a loop but may need a bit more restructuring. ExprEngine::processIndirectGoto is the last of these and probably needs a completely new loop added.<br>


<br>
Please feel free to ask more specific questions, and when you're ready send the first iteration of your patch to cfe-commits.<br>
<br>
Thanks for picking this up!<br>
<span class="HOEnZb"><font color="#888888">Jordan<br>
</font></span></blockquote></div><br></div>
</blockquote></div><br></body></html>