aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-09-21 18:25:53 +0000
committerChris Lattner <sabre@nondot.org>2007-09-21 18:25:53 +0000
commit3de66897eaec18b71475d2c47de815e3c98ebae9 (patch)
treee77ff6f20c7e0b2352538e1b626df0964a606f18
parent2966bf3bc039197f32edd562fa67aa326630a0df (diff)
downloadexternal_llvm-3de66897eaec18b71475d2c47de815e3c98ebae9.tar.gz
external_llvm-3de66897eaec18b71475d2c47de815e3c98ebae9.tar.bz2
external_llvm-3de66897eaec18b71475d2c47de815e3c98ebae9.zip
don't read Block after it is freed. This fixes PR1684
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42204 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/DwarfWriter.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/CodeGen/DwarfWriter.cpp b/lib/CodeGen/DwarfWriter.cpp
index 121ef1d9e8..ed4de7d662 100644
--- a/lib/CodeGen/DwarfWriter.cpp
+++ b/lib/CodeGen/DwarfWriter.cpp
@@ -1301,7 +1301,9 @@ public:
ValuesSet.InsertNode(Value, Where);
Values.push_back(Value);
} else {
+ // Already exists, reuse the previous one.
delete Block;
+ Block = cast<DIEBlock>(Value);
}
Die->AddValue(Attribute, Block->BestForm(), Value);