summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2009-12-22 18:34:19 +0000
committerBob Wilson <bob.wilson@apple.com>2009-12-22 18:34:19 +0000
commitbac37abe732037d8cd118b6e243ead7d35cffd4c (patch)
tree87de1c6bfd37b636ab60e59f2b82f9a4469c5f34 /llvm
parentdc72875d25e608327d5056e922caac75ea86b634 (diff)
downloadbcm5719-llvm-bac37abe732037d8cd118b6e243ead7d35cffd4c.tar.gz
bcm5719-llvm-bac37abe732037d8cd118b6e243ead7d35cffd4c.zip
Report an error for bad inline assembly, where the value passed for an
"indirect" operand is not a pointer. llvm-svn: 91913
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index f1b2c1dcc45..68a2e7b7c27 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -5482,8 +5482,12 @@ public:
// If this is an indirect operand, the operand is a pointer to the
// accessed type.
- if (isIndirect)
- OpTy = cast<PointerType>(OpTy)->getElementType();
+ if (isIndirect) {
+ const llvm::PointerType *PtrTy = dyn_cast<PointerType>(OpTy);
+ if (!PtrTy)
+ llvm_report_error("Indirect operand for inline asm not a pointer!");
+ OpTy = PtrTy->getElementType();
+ }
// If OpTy is not a single value, it may be a struct/union that we
// can tile with integers.
OpenPOWER on IntegriCloud