diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-08-24 00:35:46 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-08-24 00:35:46 +0000 |
commit | aaf217953bef3b2cc0e0f26bf474616cc20cf7f0 (patch) | |
tree | 03d4c0a9764168a4bc33cee724cb7946e531567a /lib/Target/ARM/MCTargetDesc | |
parent | 9e085a86376179cd471c3e6a59987339110ff92e (diff) | |
download | external_llvm-aaf217953bef3b2cc0e0f26bf474616cc20cf7f0.zip external_llvm-aaf217953bef3b2cc0e0f26bf474616cc20cf7f0.tar.gz external_llvm-aaf217953bef3b2cc0e0f26bf474616cc20cf7f0.tar.bz2 |
Fix undefined behavior (negation of INT_MIN) in ARM backend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162520 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/MCTargetDesc')
-rw-r--r-- | lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp b/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp index 94f1082..1917564 100644 --- a/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp +++ b/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp @@ -783,7 +783,7 @@ getT2Imm8s4OpValue(const MCInst &MI, unsigned OpIdx, // Immediate is always encoded as positive. The 'U' bit controls add vs sub. if (Imm8 < 0) - Imm8 = -Imm8; + Imm8 = -(uint32_t)Imm8; // Scaled by 4. Imm8 /= 4; |