NoQ created this revision.
Herald added subscribers: cfe-commits, rnkovacs.

Because for every symbol `$x` we can construct exactly two different 
`MemRegion`s that both get dumped as `SymRegion{$x}`, and i didn't bother 
fixing it for years, i wanted to at least make the problem apparent. With this 
patch, the unknown-memory-spaced symbolic region remains `SymRegion{$x}`, while 
the heap-based memory region is dumped as `HeapSymRegion{$x}`.

Does anybody want me to add tests for this debug print?


Repository:
  rC Clang

https://reviews.llvm.org/D40793

Files:
  lib/StaticAnalyzer/Core/MemRegion.cpp


Index: lib/StaticAnalyzer/Core/MemRegion.cpp
===================================================================
--- lib/StaticAnalyzer/Core/MemRegion.cpp
+++ lib/StaticAnalyzer/Core/MemRegion.cpp
@@ -472,6 +472,8 @@
 }
 
 void SymbolicRegion::dumpToStream(raw_ostream &os) const {
+  if (isa<HeapSpaceRegion>(getSuperRegion()))
+    os << "Heap";
   os << "SymRegion{" << sym << '}';
 }
 


Index: lib/StaticAnalyzer/Core/MemRegion.cpp
===================================================================
--- lib/StaticAnalyzer/Core/MemRegion.cpp
+++ lib/StaticAnalyzer/Core/MemRegion.cpp
@@ -472,6 +472,8 @@
 }
 
 void SymbolicRegion::dumpToStream(raw_ostream &os) const {
+  if (isa<HeapSpaceRegion>(getSuperRegion()))
+    os << "Heap";
   os << "SymRegion{" << sym << '}';
 }
 
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to