[clang] fa2a8c2 - [dataflow] Don't crash in Environment::dump when decls have weird names

Sam McCall via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 21 12:08:39 PDT 2023


Author: Sam McCall
Date: 2023-04-21T21:08:26+02:00
New Revision: fa2a8c2e1cdf188ce985d69fca6f78866390b715

URL: https://github.com/llvm/llvm-project/commit/fa2a8c2e1cdf188ce985d69fca6f78866390b715
DIFF: https://github.com/llvm/llvm-project/commit/fa2a8c2e1cdf188ce985d69fca6f78866390b715.diff

LOG: [dataflow] Don't crash in Environment::dump when decls have weird names

Added: 
    

Modified: 
    clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp b/clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp
index 446178a2a5eae..35988af6d5bc6 100644
--- a/clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp
+++ b/clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp
@@ -790,7 +790,7 @@ void Environment::dump(raw_ostream &OS) const {
   // fields are printed.
   OS << "DeclToLoc:\n";
   for (auto [D, L] : DeclToLoc)
-    OS << "  [" << D->getName() << ", " << L << "]\n";
+    OS << "  [" << D->getNameAsString() << ", " << L << "]\n";
 
   OS << "ExprToLoc:\n";
   for (auto [E, L] : ExprToLoc)


        


More information about the cfe-commits mailing list