Opaque types didn't work if llvm_is_multithreaded().
authorTorok Edwin <edwintorok@gmail.com>
Wed, 2 Sep 2009 12:23:05 +0000 (12:23 +0000)
committerTorok Edwin <edwintorok@gmail.com>
Wed, 2 Sep 2009 12:23:05 +0000 (12:23 +0000)
AlwaysOpaqueTy is always NULL at this point, and it causes an assertion failure.
Fix it by using the just constructed tmp instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80780 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/Type.cpp

index ba190d9230113fa7d08cfc00248aa21fd29c7650..1abeffa99ff6ec297788861ee4064fdfcd6145ee 100644 (file)
@@ -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;