aboutsummaryrefslogtreecommitdiffstats
path: root/lib/AsmParser/llvmAsmParser.y
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-10-03 14:59:05 +0000
committerChris Lattner <sabre@nondot.org>2001-10-03 14:59:05 +0000
commitb973dd75ba11b5304c6517bc8d48d0bc877d16ef (patch)
treec0070b21bdfd115c2351bf5646277a68e565eb3f /lib/AsmParser/llvmAsmParser.y
parentef9c23f2812322ae5c5f3140bfbcf92629d7ff47 (diff)
downloadexternal_llvm-b973dd75ba11b5304c6517bc8d48d0bc877d16ef.zip
external_llvm-b973dd75ba11b5304c6517bc8d48d0bc877d16ef.tar.gz
external_llvm-b973dd75ba11b5304c6517bc8d48d0bc877d16ef.tar.bz2
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
Diffstat (limited to 'lib/AsmParser/llvmAsmParser.y')
-rw-r--r--lib/AsmParser/llvmAsmParser.y3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/AsmParser/llvmAsmParser.y b/lib/AsmParser/llvmAsmParser.y
index 43c69f3..6808f5f 100644
--- a/lib/AsmParser/llvmAsmParser.y
+++ b/lib/AsmParser/llvmAsmParser.y
@@ -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