Fix bug caused by:
authorChris Lattner <sabre@nondot.org>
Sun, 21 Oct 2001 21:43:25 +0000 (21:43 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 21 Oct 2001 21:43:25 +0000 (21:43 +0000)
%list = type opaque
%list = type %list

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

lib/AsmParser/llvmAsmParser.y

index 128d4797758bfb95fd77c4e0593ce171eb736502..28562ac0b1e9ea653059882a6b2655691a950032 100644 (file)
@@ -431,7 +431,7 @@ static bool ResolveType(PATypeHolder<Type> &T) {
   ValID &DID = getValIDFromPlaceHolder(Ty);
 
   const Type *TheRealType = getTypeVal(DID, true);
-  if (TheRealType == 0) return true;
+  if (TheRealType == 0 || TheRealType == Ty) return true;
 
   // Refine the opaque type we had to the new type we are getting.
   cast<DerivedType>(Ty)->refineAbstractTypeTo(TheRealType);
@@ -450,7 +450,7 @@ static void ResolveTypes(vector<PATypeHolder<Type> > &LateResolveTypes) {
       ValID &DID = getValIDFromPlaceHolder(Ty);
 
       if (DID.Type == ValID::NameVal)
-       ThrowException("Reference to an invalid type: '" +DID.getName(),
+       ThrowException("Reference to an invalid type: '" +DID.getName() + "'",
                       getLineNumFromPlaceHolder(Ty));
       else
        ThrowException("Reference to an invalid type: #" + itostr(DID.Num),