Add check to make sure that we dont reference MEthodType's directly

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@704 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2001-10-03 14:59:05 +00:00
parent ef9c23f281
commit b973dd75ba

View File

@ -295,6 +295,9 @@ static Value *getVal(const Type *Ty, const ValID &D,
vector<ValueList> *LateResolver = (CurMeth.CurrentMethod) ?
&CurMeth.LateResolveValues : &CurModule.LateResolveValues;
if (isa<MethodType>(Ty))
ThrowException("Methods are not values and must be referenced as pointers");
if (const PointerType *PTy = dyn_cast<PointerType>(Ty))
if (const MethodType *MTy = dyn_cast<MethodType>(PTy->getValueType()))
Ty = MTy; // Convert pointer to method to method type