aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
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
commite261b0c90b25b7ce7a68953e7adecf370c87256e (patch)
treea0b08f7516e8da973a896cb5ab864c5bfa120b73 /lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
parentb1f49813334278094b1ecd7ad920f5c276f7b3e6 (diff)
Report an error for bad inline assembly, where the value passed for an
"indirect" operand is not a pointer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91913 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index f1b2c1dcc4..68a2e7b7c2 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/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.