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

Ismail Pazarbasi via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 18 14:50:52 PDT 2015


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

- Added a new test file instead of adding '-analyzer-viz-egraph-ubigraph' to an existing test.


http://reviews.llvm.org/D12119

Files:
  lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
  test/Analysis/ubigraph-viz.cpp

Index: test/Analysis/ubigraph-viz.cpp
===================================================================
--- /dev/null
+++ test/Analysis/ubigraph-viz.cpp
@@ -0,0 +1,7 @@
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.API -analyzer-viz-egraph-ubigraph -verify %s
+// expected-no-diagnostics
+
+int f(int x) {
+  return x < 0 ? 0 : 42;
+}
+
Index: lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
===================================================================
--- lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
+++ lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
@@ -778,8 +778,9 @@
        << ", ('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> OutStream,
+                         StringRef Filename)
+    : Out(std::move(OutStream)), 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.35141.patch
Type: text/x-patch
Size: 1130 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150918/33e0447d/attachment.bin>


More information about the cfe-commits mailing list