aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-10-09 02:18:58 +0000
committerChris Lattner <sabre@nondot.org>2004-10-09 02:18:58 +0000
commit1c1bb33534493619813a305d726ea8e2da7ecdc3 (patch)
treee375bcf796ad46b61b46eef1c2eaf1e2a682dc60 /lib
parent222b86f6947b68f6fd3b298c17ea8dd7f2e1455f (diff)
downloadexternal_llvm-1c1bb33534493619813a305d726ea8e2da7ecdc3.zip
external_llvm-1c1bb33534493619813a305d726ea8e2da7ecdc3.tar.gz
external_llvm-1c1bb33534493619813a305d726ea8e2da7ecdc3.tar.bz2
Add a check to avoid an assertion on malformed input
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16861 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-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 ce92c9c..70aee05 100644
--- a/lib/AsmParser/llvmAsmParser.y
+++ b/lib/AsmParser/llvmAsmParser.y
@@ -2120,6 +2120,9 @@ MemoryInst : MALLOC Types {
if (!isa<PointerType>($3->get()))
ThrowException("Can't load from nonpointer type: " +
(*$3)->getDescription());
+ if (!cast<PointerType>($3->get())->getElementType()->isFirstClassType())
+ ThrowException("Can't load from pointer of non-first-class type: " +
+ (*$3)->getDescription());
$$ = new LoadInst(getVal(*$3, $4), "", $1);
delete $3;
}