[PATCH] D12119: Analyzer: Fix a crasher in UbigraphViz

Ismail Pazarbasi via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 20 14:08:59 PDT 2015


ismailp updated this revision to Diff 32745.
ismailp added a comment.

- Renamed `Out` parameter to `Stm`.
- Removed assertion that checks whether an ExplodedNode has an edge to itself.
- Added '-analyzer-viz-egraph-ubigraph' to an analyzer invocation in a test.


http://reviews.llvm.org/D12119

Files:
  lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
  test/Analysis/cfg.cpp

Index: test/Analysis/cfg.cpp
===================================================================
--- test/Analysis/cfg.cpp
+++ test/Analysis/cfg.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=debug.DumpCFG -triple x86_64-apple-darwin12 -analyzer-config cfg-temporary-dtors=true -std=c++11 %s > %t 2>&1
+// RUN: %clang_cc1 -analyze -analyzer-checker=debug.DumpCFG -triple x86_64-apple-darwin12 -analyzer-config cfg-temporary-dtors=true -analyzer-viz-egraph-ubigraph -std=c++11 %s > %t 2>&1
 // RUN: FileCheck --input-file=%t %s
 
 // CHECK-LABEL: void checkWrap(int i)
Index: lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
===================================================================
--- lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
+++ lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
@@ -745,9 +745,6 @@
 }
 
 void UbigraphViz::AddEdge(ExplodedNode *Src, ExplodedNode *Dst) {
-
-  assert (Src != Dst && "Self-edges are not allowed.");
-
   // Lookup the Src.  If it is a new node, it's a root.
   VMap::iterator SrcI= M.find(Src);
   unsigned SrcID;
@@ -778,8 +775,8 @@
        << ", ('arrow','true'), ('oriented', 'true'))\n";
 }
 
-UbigraphViz::UbigraphViz(std::unique_ptr<raw_ostream> Out, StringRef Filename)
-    : Out(std::move(Out)), Filename(Filename), Cntr(0) {
+UbigraphViz::UbigraphViz(std::unique_ptr<raw_ostream> Stm, StringRef Filename)
+    : Out(std::move(Stm)), Filename(Filename), Cntr(0) {
 
   *Out << "('vertex_style_attribute', 0, ('shape', 'icosahedron'))\n";
   *Out << "('vertex_style', 1, 0, ('shape', 'sphere'), ('color', '#ffcc66'),"


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12119.32745.patch
Type: text/x-patch
Size: 1596 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150820/789e085c/attachment-0001.bin>


More information about the cfe-commits mailing list