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

llvm-svn: 704
This commit is contained in:
Chris Lattner 2001-10-03 14:59:05 +00:00
parent a01eda3091
commit a6c7a3f199

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