Add check to make sure that we dont reference MEthodType's directly
authorChris Lattner <sabre@nondot.org>
Wed, 3 Oct 2001 14:59:05 +0000 (14:59 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 3 Oct 2001 14:59:05 +0000 (14:59 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@704 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AsmParser/llvmAsmParser.y

index 43c69f3a08ad4b28d8b90bc947c29ba4313b81bc..6808f5ff9b464ccae5599aeefaa7889ba659b14e 100644 (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