aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/CBackend/CBackend.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Target/CBackend/CBackend.cpp')
-rw-r--r--lib/Target/CBackend/CBackend.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp
index 941af03af2..bc3829f67c 100644
--- a/lib/Target/CBackend/CBackend.cpp
+++ b/lib/Target/CBackend/CBackend.cpp
@@ -916,7 +916,7 @@ void CWriter::printIndexingExpression(Value *Ptr, User::op_iterator I,
}
for (; I != E; ++I)
- if ((*I)->getType() == Type::UIntTy) {
+ if ((*I)->getType() == Type::LongTy) {
Out << "[((int) ("; // sign-extend from 32 (to 64) bits
writeOperand(*I);
Out << " * sizeof(";
@@ -925,7 +925,7 @@ void CWriter::printIndexingExpression(Value *Ptr, User::op_iterator I,
printType(cast<PointerType>(Ptr->getType())->getElementType());
Out << ")]";
} else {
- Out << ".field" << cast<ConstantUInt>(*I)->getValue();
+ Out << ".field" << cast<ConstantSInt>(*I)->getValue();
}
}