summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExprScalar.cpp
diff options
context:
space:
mode:
authorMichael Liao <michael.liao@intel.com>2012-08-28 16:55:13 +0000
committerMichael Liao <michael.liao@intel.com>2012-08-28 16:55:13 +0000
commit48f498fccf84d4b8888a567884cb935a4f457741 (patch)
tree440e14aea342c0534be908d9d6846620ca62cfe8 /clang/lib/CodeGen/CGExprScalar.cpp
parent2a226a61daea6282cb20eca5bdd51360e3b801bd (diff)
downloadbcm5719-llvm-48f498fccf84d4b8888a567884cb935a4f457741.tar.gz
bcm5719-llvm-48f498fccf84d4b8888a567884cb935a4f457741.zip
Fix PR13704
- The increment needs to be signed value to preserve the original value when its data type is larger than 64-bit integer. llvm-svn: 162766
Diffstat (limited to 'clang/lib/CodeGen/CGExprScalar.cpp')
-rw-r--r--clang/lib/CodeGen/CGExprScalar.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGExprScalar.cpp b/clang/lib/CodeGen/CGExprScalar.cpp
index f304317756b..58692f5cb35 100644
--- a/clang/lib/CodeGen/CGExprScalar.cpp
+++ b/clang/lib/CodeGen/CGExprScalar.cpp
@@ -1306,7 +1306,7 @@ ScalarExprEmitter::EmitScalarPrePostIncDec(const UnaryOperator *E, LValue LV,
// Most common case by far: integer increment.
} else if (type->isIntegerType()) {
- llvm::Value *amt = llvm::ConstantInt::get(value->getType(), amount);
+ llvm::Value *amt = llvm::ConstantInt::get(value->getType(), amount, true);
// Note that signed integer inc/dec with width less than int can't
// overflow because of promotion rules; we're just eliding a few steps here.
OpenPOWER on IntegriCloud