don't crash in some bad cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20776 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2005-03-23 01:29:26 +00:00
parent 1e9d1475bc
commit 60cd9558ba

View File

@ -330,6 +330,9 @@ static Value *getVal(const Type *Ty, const ValID &ID) {
Value *V = getValNonImprovising(Ty, ID);
if (V) return V;
if (!Ty->isFirstClassType() && !isa<OpaqueType>(Ty))
ThrowException("Invalid use of a composite type!");
// If we reached here, we referenced either a symbol that we don't know about
// or an id number that hasn't been read yet. We may be referencing something
// forward, so just create an entry to be resolved later and get to it...