svf-tools 1.0.792 → 1.0.793

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -230,12 +230,12 @@ Protected Attributes</h2></td></tr>
230
230
 
231
231
  <p>Get the wto-cycle-depth of the given node. </p>
232
232
 
233
- <p class="definition">Definition at line <a class="el" href="WTO_8h_source.html#l00701">701</a> of file <a class="el" href="WTO_8h_source.html">WTO.h</a>.</p>
234
- <div class="fragment"><div class="line"><a name="l00702"></a><span class="lineno"> 702</span>&#160; {</div>
235
- <div class="line"><a name="l00703"></a><span class="lineno"> 703</span>&#160; <span class="keyword">auto</span> it = <a class="code" href="classSVF_1_1CFBasicBlockGWTO_1_1TailBuilder.html#a0a06c8bb53552030d11398955eae665c">_nodeToWTOCycleDepth</a>.find(<a class="code" href="cJSON_8cpp.html#ab6e2ea6dc7bd57d1483413449998230a">n</a>);</div>
236
- <div class="line"><a name="l00704"></a><span class="lineno"> 704</span>&#160; assert(it != <a class="code" href="classSVF_1_1CFBasicBlockGWTO_1_1TailBuilder.html#a0a06c8bb53552030d11398955eae665c">_nodeToWTOCycleDepth</a>.end() &amp;&amp; <span class="stringliteral">&quot;node not found&quot;</span>);</div>
237
- <div class="line"><a name="l00705"></a><span class="lineno"> 705</span>&#160; <span class="keywordflow">return</span> *(it-&gt;second);</div>
238
- <div class="line"><a name="l00706"></a><span class="lineno"> 706</span>&#160; }</div>
233
+ <p class="definition">Definition at line <a class="el" href="WTO_8h_source.html#l00702">702</a> of file <a class="el" href="WTO_8h_source.html">WTO.h</a>.</p>
234
+ <div class="fragment"><div class="line"><a name="l00703"></a><span class="lineno"> 703</span>&#160; {</div>
235
+ <div class="line"><a name="l00704"></a><span class="lineno"> 704</span>&#160; <span class="keyword">auto</span> it = <a class="code" href="classSVF_1_1CFBasicBlockGWTO_1_1TailBuilder.html#a0a06c8bb53552030d11398955eae665c">_nodeToWTOCycleDepth</a>.find(<a class="code" href="cJSON_8cpp.html#ab6e2ea6dc7bd57d1483413449998230a">n</a>);</div>
236
+ <div class="line"><a name="l00705"></a><span class="lineno"> 705</span>&#160; assert(it != <a class="code" href="classSVF_1_1CFBasicBlockGWTO_1_1TailBuilder.html#a0a06c8bb53552030d11398955eae665c">_nodeToWTOCycleDepth</a>.end() &amp;&amp; <span class="stringliteral">&quot;node not found&quot;</span>);</div>
237
+ <div class="line"><a name="l00706"></a><span class="lineno"> 706</span>&#160; <span class="keywordflow">return</span> *(it-&gt;second);</div>
238
+ <div class="line"><a name="l00707"></a><span class="lineno"> 707</span>&#160; }</div>
239
239
  </div><!-- fragment -->
240
240
  </div>
241
241
  </div>
@@ -320,15 +320,16 @@ Protected Attributes</h2></td></tr>
320
320
  <div class="line"><a name="l00686"></a><span class="lineno"> 686</span>&#160; {</div>
321
321
  <div class="line"><a name="l00687"></a><span class="lineno"> 687</span>&#160; <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span> &amp;edge: node.node()-&gt;getOutEdges())</div>
322
322
  <div class="line"><a name="l00688"></a><span class="lineno"> 688</span>&#160; {</div>
323
- <div class="line"><a name="l00689"></a><span class="lineno"> 689</span>&#160; <span class="keyword">const</span> CFBasicBlockNode *succ = edge-&gt;getDstNode();</div>
324
- <div class="line"><a name="l00690"></a><span class="lineno"> 690</span>&#160; <span class="keyword">const</span> <a class="code" href="classSVF_1_1CFBasicBlockGWTO.html#acc7a69f2e4d44bda34a84ed68667b803">CFBasicBlockGWTOCycleDepth</a> &amp;succNesting = <a class="code" href="classSVF_1_1CFBasicBlockGWTO_1_1TailBuilder.html#a0efb4902bc6933e28b042edf6fc3f94c">getWTOCycleDepth</a>(succ);</div>
325
- <div class="line"><a name="l00691"></a><span class="lineno"> 691</span>&#160; <span class="keywordflow">if</span> (succ != <a class="code" href="classSVF_1_1CFBasicBlockGWTO_1_1TailBuilder.html#ae846777ace039ab74fad15ee52884f44">_head</a> &amp;&amp; succNesting &lt;= <a class="code" href="classSVF_1_1CFBasicBlockGWTO_1_1TailBuilder.html#a27e3f03587ce871f41853e3be2537209">_headWTOCycleDepth</a>)</div>
326
- <div class="line"><a name="l00692"></a><span class="lineno"> 692</span>&#160; {</div>
327
- <div class="line"><a name="l00693"></a><span class="lineno"> 693</span>&#160; <a class="code" href="classSVF_1_1CFBasicBlockGWTO_1_1TailBuilder.html#a6328b869dd664d4eca8e13c4dae3703b">_tails</a>.insert(node.node());</div>
328
- <div class="line"><a name="l00694"></a><span class="lineno"> 694</span>&#160; }</div>
329
- <div class="line"><a name="l00695"></a><span class="lineno"> 695</span>&#160; }</div>
330
- <div class="line"><a name="l00696"></a><span class="lineno"> 696</span>&#160; }</div>
331
- <div class="line"><a name="l00697"></a><span class="lineno"> 697</span>&#160; }</div>
323
+ <div class="line"><a name="l00689"></a><span class="lineno"> 689</span>&#160; <span class="keywordflow">if</span>(edge-&gt;getICFGEdge() &amp;&amp; !edge-&gt;getICFGEdge()-&gt;isIntraCFGEdge()) <span class="keywordflow">continue</span>;</div>
324
+ <div class="line"><a name="l00690"></a><span class="lineno"> 690</span>&#160; <span class="keyword">const</span> CFBasicBlockNode *succ = edge-&gt;getDstNode();</div>
325
+ <div class="line"><a name="l00691"></a><span class="lineno"> 691</span>&#160; <span class="keyword">const</span> <a class="code" href="classSVF_1_1CFBasicBlockGWTO.html#acc7a69f2e4d44bda34a84ed68667b803">CFBasicBlockGWTOCycleDepth</a> &amp;succNesting = <a class="code" href="classSVF_1_1CFBasicBlockGWTO_1_1TailBuilder.html#a0efb4902bc6933e28b042edf6fc3f94c">getWTOCycleDepth</a>(succ);</div>
326
+ <div class="line"><a name="l00692"></a><span class="lineno"> 692</span>&#160; <span class="keywordflow">if</span> (succ != <a class="code" href="classSVF_1_1CFBasicBlockGWTO_1_1TailBuilder.html#ae846777ace039ab74fad15ee52884f44">_head</a> &amp;&amp; succNesting &lt;= <a class="code" href="classSVF_1_1CFBasicBlockGWTO_1_1TailBuilder.html#a27e3f03587ce871f41853e3be2537209">_headWTOCycleDepth</a>)</div>
327
+ <div class="line"><a name="l00693"></a><span class="lineno"> 693</span>&#160; {</div>
328
+ <div class="line"><a name="l00694"></a><span class="lineno"> 694</span>&#160; <a class="code" href="classSVF_1_1CFBasicBlockGWTO_1_1TailBuilder.html#a6328b869dd664d4eca8e13c4dae3703b">_tails</a>.insert(node.node());</div>
329
+ <div class="line"><a name="l00695"></a><span class="lineno"> 695</span>&#160; }</div>
330
+ <div class="line"><a name="l00696"></a><span class="lineno"> 696</span>&#160; }</div>
331
+ <div class="line"><a name="l00697"></a><span class="lineno"> 697</span>&#160; }</div>
332
+ <div class="line"><a name="l00698"></a><span class="lineno"> 698</span>&#160; }</div>
332
333
  </div><!-- fragment -->
333
334
  </div>
334
335
  </div>
@@ -458,7 +459,7 @@ Protected Attributes</h2></td></tr>
458
459
  </ul>
459
460
  </div><!-- contents -->
460
461
  <div class="ttc" id="aclassSVF_1_1CFBasicBlockGWTO_1_1TailBuilder_html_a0a06c8bb53552030d11398955eae665c"><div class="ttname"><a href="classSVF_1_1CFBasicBlockGWTO_1_1TailBuilder.html#a0a06c8bb53552030d11398955eae665c">SVF::CFBasicBlockGWTO::TailBuilder::_nodeToWTOCycleDepth</a></div><div class="ttdeci">NodeRefToWTOCycleDepthPtr &amp; _nodeToWTOCycleDepth</div><div class="ttdef"><b>Definition:</b> <a href="WTO_8h_source.html#l00655">WTO.h:655</a></div></div>
461
- <div class="ttc" id="aclassSVF_1_1CFBasicBlockGWTO_1_1TailBuilder_html_a0efb4902bc6933e28b042edf6fc3f94c"><div class="ttname"><a href="classSVF_1_1CFBasicBlockGWTO_1_1TailBuilder.html#a0efb4902bc6933e28b042edf6fc3f94c">SVF::CFBasicBlockGWTO::TailBuilder::getWTOCycleDepth</a></div><div class="ttdeci">const CFBasicBlockGWTOCycleDepth &amp; getWTOCycleDepth(const CFBasicBlockNode *n) const</div><div class="ttdoc">Get the wto-cycle-depth of the given node.</div><div class="ttdef"><b>Definition:</b> <a href="WTO_8h_source.html#l00701">WTO.h:701</a></div></div>
462
+ <div class="ttc" id="aclassSVF_1_1CFBasicBlockGWTO_1_1TailBuilder_html_a0efb4902bc6933e28b042edf6fc3f94c"><div class="ttname"><a href="classSVF_1_1CFBasicBlockGWTO_1_1TailBuilder.html#a0efb4902bc6933e28b042edf6fc3f94c">SVF::CFBasicBlockGWTO::TailBuilder::getWTOCycleDepth</a></div><div class="ttdeci">const CFBasicBlockGWTOCycleDepth &amp; getWTOCycleDepth(const CFBasicBlockNode *n) const</div><div class="ttdoc">Get the wto-cycle-depth of the given node.</div><div class="ttdef"><b>Definition:</b> <a href="WTO_8h_source.html#l00702">WTO.h:702</a></div></div>
462
463
  <div class="ttc" id="acJSON_8cpp_html_ab6e2ea6dc7bd57d1483413449998230a"><div class="ttname"><a href="cJSON_8cpp.html#ab6e2ea6dc7bd57d1483413449998230a">n</a></div><div class="ttdeci">cJSON * n</div><div class="ttdef"><b>Definition:</b> <a href="cJSON_8cpp_source.html#l02558">cJSON.cpp:2558</a></div></div>
463
464
  <div class="ttc" id="aclassSVF_1_1CFBasicBlockGWTO_1_1TailBuilder_html_a27e3f03587ce871f41853e3be2537209"><div class="ttname"><a href="classSVF_1_1CFBasicBlockGWTO_1_1TailBuilder.html#a27e3f03587ce871f41853e3be2537209">SVF::CFBasicBlockGWTO::TailBuilder::_headWTOCycleDepth</a></div><div class="ttdeci">const CFBasicBlockGWTOCycleDepth &amp; _headWTOCycleDepth</div><div class="ttdef"><b>Definition:</b> <a href="WTO_8h_source.html#l00653">WTO.h:653</a></div></div>
464
465
  <div class="ttc" id="aclassSVF_1_1CFBasicBlockGWTO_1_1TailBuilder_html_a6328b869dd664d4eca8e13c4dae3703b"><div class="ttname"><a href="classSVF_1_1CFBasicBlockGWTO_1_1TailBuilder.html#a6328b869dd664d4eca8e13c4dae3703b">SVF::CFBasicBlockGWTO::TailBuilder::_tails</a></div><div class="ttdeci">NodeRefSet &amp; _tails</div><div class="ttdef"><b>Definition:</b> <a href="WTO_8h_source.html#l00652">WTO.h:652</a></div></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svf-tools",
3
- "version": "1.0.792",
3
+ "version": "1.0.793",
4
4
  "description": "* <b>[TypeClone](https://github.com/SVF-tools/SVF/wiki/TypeClone) published in our [ECOOP paper](https://yuleisui.github.io/publications/ecoop20.pdf) is now available in SVF </b> * <b>SVF now uses a single script for its build. Just type [`source ./build.sh`](https://github.com/SVF-tools/SVF/blob/master/build.sh) in your terminal, that's it!</b> * <b>SVF now supports LLVM-10.0.0! </b> * <b>We thank [bsauce](https://github.com/bsauce) for writing a user manual of SVF ([link1](https://www.jianshu.com/p/068a08ec749c) and [link2](https://www.jianshu.com/p/777c30d4240e)) in Chinese </b> * <b>SVF now supports LLVM-9.0.0 (Thank [Byoungyoung Lee](https://github.com/SVF-tools/SVF/issues/142) for his help!). </b> * <b>SVF now supports a set of [field-sensitive pointer analyses](https://yuleisui.github.io/publications/sas2019a.pdf). </b> * <b>[Use SVF as an external lib](https://github.com/SVF-tools/SVF/wiki/Using-SVF-as-a-lib-in-your-own-tool) for your own project (Contributed by [Hongxu Chen](https://github.com/HongxuChen)). </b> * <b>SVF now supports LLVM-7.0.0. </b> * <b>SVF now supports Docker. [Try SVF in Docker](https://github.com/SVF-tools/SVF/wiki/Try-SVF-in-Docker)! </b> * <b>SVF now supports [LLVM-6.0.0](https://github.com/svf-tools/SVF/pull/38) (Contributed by [Jack Anthony](https://github.com/jackanth)). </b> * <b>SVF now supports [LLVM-4.0.0](https://github.com/svf-tools/SVF/pull/23) (Contributed by Jared Carlson. Thank [Jared](https://github.com/jcarlson23) and [Will](https://github.com/dtzWill) for their in-depth [discussions](https://github.com/svf-tools/SVF/pull/18) about updating SVF!) </b> * <b>SVF now supports analysis for C++ programs.</b> <br />",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -686,6 +686,7 @@ protected:
686
686
  {
687
687
  for (const auto &edge: node.node()->getOutEdges())
688
688
  {
689
+ if(edge->getICFGEdge() && !edge->getICFGEdge()->isIntraCFGEdge()) continue;
689
690
  const CFBasicBlockNode *succ = edge->getDstNode();
690
691
  const CFBasicBlockGWTOCycleDepth &succNesting = getWTOCycleDepth(succ);
691
692
  if (succ != _head && succNesting <= _headWTOCycleDepth)
@@ -777,6 +778,7 @@ protected:
777
778
  {
778
779
  for (auto it = node->getOutEdges().begin(), et = node->getOutEdges().end(); it != et; ++it)
779
780
  {
781
+ if((*it)->getICFGEdge() && !(*it)->getICFGEdge()->isIntraCFGEdge()) continue;
780
782
  const CFBasicBlockNode *succ = (*it)->getDstNode();
781
783
  if (getCDN(succ) == 0)
782
784
  {
@@ -823,6 +825,7 @@ protected:
823
825
  {
824
826
  for (auto it = node->getOutEdges().begin(), et = node->getOutEdges().end(); it != et; ++it)
825
827
  {
828
+ if((*it)->getICFGEdge() && !(*it)->getICFGEdge()->isIntraCFGEdge()) continue;
826
829
  const CFBasicBlockNode *succ = (*it)->getDstNode();
827
830
  if (succ->getFunction() != node->getFunction())
828
831
  continue;
@@ -64,11 +64,6 @@ void
64
64
  CDGBuilder::extractNodesBetweenPdomNodes(const SVFBasicBlock *succ, const SVFBasicBlock *LCA,
65
65
  std::vector<const SVFBasicBlock *> &tgtNodes)
66
66
  {
67
- if (LCA == NULL)
68
- {
69
- tgtNodes.push_back(succ);
70
- return;
71
- }
72
67
  if (succ == LCA) return;
73
68
  std::vector<const SVFBasicBlock *> path;
74
69
  SVFLoopAndDomInfo *ld = const_cast<SVFFunction *>(LCA->getFunction())->getLoopAndDomInfo();
@@ -103,7 +98,10 @@ s64_t CDGBuilder::getBBSuccessorBranchID(const SVFBasicBlock *BB, const SVFBasic
103
98
  }
104
99
  if (const IntraCFGEdge *intraEdge = SVFUtil::dyn_cast<IntraCFGEdge>(edge))
105
100
  {
106
- return intraEdge->getSuccessorCondValue();
101
+ if(intraEdge->getCondition())
102
+ return intraEdge->getSuccessorCondValue();
103
+ else
104
+ return 0;
107
105
  }
108
106
  else
109
107
  {
@@ -140,9 +138,15 @@ void CDGBuilder::buildControlDependence(const SVFModule *svfgModule)
140
138
  const SVFBasicBlock *SVFLCA = const_cast<SVFFunction *>(svfFun)->
141
139
  getLoopAndDomInfo()->findNearestCommonPDominator(pred, succ);
142
140
  std::vector<const SVFBasicBlock *> tgtNodes;
143
- if (SVFLCA == pred) tgtNodes.push_back(SVFLCA);
144
- // from succ to LCA
145
- extractNodesBetweenPdomNodes(succ, SVFLCA, tgtNodes);
141
+ // no common ancestor, may be exit()
142
+ if (SVFLCA == NULL)
143
+ tgtNodes.push_back(succ);
144
+ else
145
+ {
146
+ if (SVFLCA == pred) tgtNodes.push_back(SVFLCA);
147
+ // from succ to LCA
148
+ extractNodesBetweenPdomNodes(succ, SVFLCA, tgtNodes);
149
+ }
146
150
 
147
151
  s64_t pos = getBBSuccessorBranchID(pred, succ);
148
152
  for (const SVFBasicBlock *bb: tgtNodes)