From 82131d6ad78d3762756c7ccee3aadb6079feb554 Mon Sep 17 00:00:00 2001 From: Torok Edwin Date: Wed, 2 Sep 2009 12:23:05 +0000 Subject: [PATCH] Opaque types didn't work if llvm_is_multithreaded(). AlwaysOpaqueTy is always NULL at this point, and it causes an assertion failure. Fix it by using the just constructed tmp instead. llvm-svn: 80780 --- llvm/lib/VMCore/Type.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/VMCore/Type.cpp b/llvm/lib/VMCore/Type.cpp index ba190d923011..1abeffa99ff6 100644 --- a/llvm/lib/VMCore/Type.cpp +++ b/llvm/lib/VMCore/Type.cpp @@ -492,7 +492,7 @@ void DerivedType::dropAllTypeUses() { tmp = AlwaysOpaqueTy; if (!tmp) { tmp = OpaqueType::get(getContext()); - PATypeHolder* tmp2 = new PATypeHolder(AlwaysOpaqueTy); + PATypeHolder* tmp2 = new PATypeHolder(tmp); sys::MemoryFence(); AlwaysOpaqueTy = tmp; Holder = tmp2;