<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;" class="">Hi Daniel,<div class=""><br class=""></div><div class="">As Jordan mentioned earlier, I am concerned about making test after div-zero/dereference checkers rely on path sensitive analysis. These require all path reasoning and the analyzer does not guarantee to cover all paths (some of them might be silently dropped). My understanding is that you are working around this by performing checking within a single basic block; however, in that case relying on the power of path sensitivity is an overkill. I think it’s best to write these as non-path sensitive data flow analysis on the CFG. What do you think?</div><div class=""><br class=""></div><div class="">If we decided to go with path-sensitive checkers for this, addition of the base class would be the right way to go.</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Aug 24, 2014, at 2:25 AM, Daniel Marjamäki <<a href="mailto:Daniel.Marjamaki@evidente.se" class="">Daniel.Marjamaki@evidente.se</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; direction: ltr; font-family: Tahoma; font-size: 10pt;" class="">Hello!<br class=""><br class="">Recently a TestAfterDivZero checker was added to the static analyser (r212731).<br class=""><br class="">We could add many related checkers, for example:<br class=""> * test after null pointer dereference<br class=""> * test after array index out of bounds<br class=""> * test after dangerous/invalid function argument<br class=""> * ...<br class=""><br class="">I wonder what you think about creating generic base classes for TestAfterX checkers. Would you prefer copy/paste?<br class=""><br class="">I attach a proof of concept patch. It adds a include file llvm/tools/clang/include/StaticAnalyzer/Core/TestAfterChecker.h. </div></div></blockquote><div><br class=""></div><div>This one should be added under include/clang/StaticAnalyzer/Checkers/. See ObjCRetainCount.h as an example.</div><br class=""><blockquote type="cite" class=""><div class=""><div style="font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; direction: ltr; font-family: Tahoma; font-size: 10pt;" class="">Is that the proper path where it should be or would it be better somewhere else? There is no implementation but I should add it in llvm/tools/clang/lib/StaticAnalyzer/Core/TestAfterChecker.cpp, shouldn't I? Do you have an opinion about the namespace usage?<br class=""><br class="">It might still be possible to move some more code from the checker to the base classes. The current code is work-in-progress.<br class=""><br class=""><div class="">Best regards,<br class="">Daniel Marjamäki<br class=""><br class=""><div style="font-family: Tahoma; font-size: 13px;" class=""><div style="font-family: Tahoma; font-size: 13px;" class=""><div style="font-family: Tahoma; font-size: 13px;" class=""><div style="font-family: Tahoma; font-size: 13px;" class=""><div style="font-family: Tahoma; font-size: 13px;" class=""><div style="font-family: Tahoma; font-size: 13px;" class=""><div style="margin: 0cm 0cm 0pt;" class=""><span style="font-family: Arial, sans-serif; color: gray; font-size: 8pt;" class="">..................................................................................................................</span></div><div style="margin: 0cm 0cm 0pt;" class=""><span style="font-family: Arial, sans-serif; font-size: 8pt;" class="">Daniel Marjamäki<span class="Apple-converted-space"> </span></span><span style="font-family: Arial, sans-serif; color: gray; font-size: 8pt;" class="">Senior Engineer</span></div><div style="margin: 0cm 0cm 0pt;" class=""><span lang="EN-US" style="font-family: Arial, sans-serif; color: gray; font-size: 8.5pt;" class="">Evidente ES East</span><span lang="EN-US" style="font-family: Arial, sans-serif; color: gray; font-size: 8pt;" class=""><span class="Apple-converted-space"> </span>AB<span class=""> <span class="Apple-converted-space"> </span></span>Warfvinges väg 34<span class=""> <span class="Apple-converted-space"> </span></span>SE-112 51 Stockholm<span class=""> <span class="Apple-converted-space"> </span></span>Sweden<span class="Apple-converted-space"> </span></span></div><p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span lang="EN-US" style="font-family: Arial, sans-serif; color: gray; font-size: 8pt;" class=""></span> </p><div style="margin: 0cm 0cm 0pt;" class=""><span lang="EN-GB" style="font-family: Arial, sans-serif; color: gray; font-size: 8pt;" class="">Mobile</span><span lang="EN-GB" style="font-family: Arial, sans-serif; color: gray; font-size: 8pt;" class="">:<span class="">                <span class="Apple-converted-space"> </span></span>+46 (0)709 12 42 62</span></div><div style="margin: 0cm 0cm 0pt;" class=""><span lang="EN-GB" style="font-family: Arial, sans-serif; color: gray; font-size: 8pt;" class=""></span><span lang="EN-GB" style="font-family: Arial, sans-serif; color: gray; font-size: 8pt;" class="">E-mail:<span class="">   <span class="Apple-converted-space"> </span></span><span class="">            <span class="Apple-converted-space"> </span><a tabindex="0" href="mailto:Daniel.Marjamaki@evidente.se" class="">Daniel.Marjamaki</a></span><a tabindex="0" href="mailto:Daniel.Marjamaki@evidente.se" class="">@evidente.se</a><span class="">     <span class="Apple-converted-space"> </span></span><span class="">                <span class="Apple-converted-space"> </span></span></span></div><p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span lang="EN-GB" style="font-family: Arial, sans-serif; color: gray; font-size: 8pt;" class=""></span> </p><div style="margin: 0cm 0cm 0pt;" class=""><span lang="EN-GB" style="font-family: Arial, sans-serif; font-size: 8pt;" class=""><a href="http://www.evidente.se/" class="">www.evidente.se</a></span></div></div></div></div></div></div></div></div></div><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">_______________________________________________</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">cfe-dev mailing list</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="mailto:cfe-dev@cs.uiuc.edu" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">cfe-dev@cs.uiuc.edu</a><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a></div></blockquote></div><br class=""></div></body></html>