summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/ARM
diff options
context:
space:
mode:
authorJoey Gouly <joey.gouly@arm.com>2013-07-05 10:19:40 +0000
committerJoey Gouly <joey.gouly@arm.com>2013-07-05 10:19:40 +0000
commit606f3fbc2b295dce7462a511674e6c8d4add8040 (patch)
tree60503af8e362188ad3a934ed515a90eb92042f89 /llvm/lib/Target/ARM
parent0e90c3d92c0caddd4b1a37293715460c10aed80d (diff)
downloadbcm5719-llvm-606f3fbc2b295dce7462a511674e6c8d4add8040.tar.gz
bcm5719-llvm-606f3fbc2b295dce7462a511674e6c8d4add8040.zip
PR16490: fix a crash in ARMDAGToDAGISel::SelectInlineAsm.
In the SelectionDAG immediate operands to inline asm are constructed as two separate operands. The first is a constant of value InlineAsm::Kind_Imm and the second is a constant with the value of the immediate. In ARMDAGToDAGISel::SelectInlineAsm, if we reach an operand of Kind_Imm we should skip over the next operand too. llvm-svn: 185688
Diffstat (limited to 'llvm/lib/Target/ARM')
-rw-r--r--llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp b/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp
index c85dcb4e79d..da0fe2cf7d4 100644
--- a/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp
+++ b/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp
@@ -3491,6 +3491,12 @@ SDNode *ARMDAGToDAGISel::SelectInlineAsm(SDNode *N){
else
continue;
+ if (Kind == InlineAsm::Kind_Imm) {
+ SDValue op = N->getOperand(++i);
+ AsmNodeOperands.push_back(op);
+ continue;
+ }
+
unsigned NumRegs = InlineAsm::getNumOperandRegisters(Flag);
if (NumRegs)
OpChanged.push_back(false);
OpenPOWER on IntegriCloud