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

Ismail Pazarbasi via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 18 15:01:13 PDT 2015


ismailp created this revision.
ismailp added reviewers: zaks.anna, krememek.
ismailp added a subscriber: cfe-commits.

Name `Out` refers to the parameter. It is moved into the member `Out`
in ctor-init. Dereferencing null pointer will crash clang, if user
passes '-analyzer-viz-egraph-ubigraph' argument.

http://reviews.llvm.org/D12119

Files:
  lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp

Index: lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
===================================================================
--- lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
+++ lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
@@ -781,8 +781,8 @@
 UbigraphViz::UbigraphViz(std::unique_ptr<raw_ostream> Out, StringRef Filename)
     : Out(std::move(Out)), Filename(Filename), Cntr(0) {
 
-  *Out << "('vertex_style_attribute', 0, ('shape', 'icosahedron'))\n";
-  *Out << "('vertex_style', 1, 0, ('shape', 'sphere'), ('color', '#ffcc66'),"
+  *this->Out << "('vertex_style_attribute', 0, ('shape', 'icosahedron'))\n";
+  *this->Out << "('vertex_style', 1, 0, ('shape', 'sphere'), ('color', '#ffcc66'),"
           " ('size', '1.5'))\n";
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12119.32459.patch
Type: text/x-patch
Size: 743 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150818/e859fda5/attachment.bin>


More information about the cfe-commits mailing list