diff options
author | Michael Liao <michael.liao@intel.com> | 2012-08-28 16:55:13 +0000 |
---|---|---|
committer | Michael Liao <michael.liao@intel.com> | 2012-08-28 16:55:13 +0000 |
commit | 36d5ceaab220422c24464c11b946488f0b075cd5 (patch) | |
tree | 018e12cf7c76e5e9c946287ce8fcd5bb4263c79e /lib/CodeGen/CGExprScalar.cpp | |
parent | 92daae0186a4b25a189132d65213b53745c42986 (diff) |
Fix PR13704
- The increment needs to be signed value to preserve the original value when
its data type is larger than 64-bit integer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162766 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprScalar.cpp')
-rw-r--r-- | lib/CodeGen/CGExprScalar.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/CodeGen/CGExprScalar.cpp b/lib/CodeGen/CGExprScalar.cpp index f304317756..58692f5cb3 100644 --- a/lib/CodeGen/CGExprScalar.cpp +++ b/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. |