diff options
author | Bob Wilson <bob.wilson@apple.com> | 2014-11-12 23:01:24 +0000 |
---|---|---|
committer | Bob Wilson <bob.wilson@apple.com> | 2014-11-12 23:01:24 +0000 |
commit | b90f66ba9d0f2ae2ab7a2ac56e3113d6caa2faad (patch) | |
tree | 658476527299026e3c0b8d10ef8e825b9e64dcb3 /lib/builtins/addvti3.c | |
parent | bdfc9db9d74625ef1065b161774800b6323026ed (diff) |
PR21518: Use unsigned arithmetic for trapping add/sub functions.
The code in {add,sub}v.i3 routines does not trap when it should, because
it performs the actual add/subtract operation in signed arithmetic,
rather than unsigned.
Patch by Francois-Xavie Coudert!
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221826 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/builtins/addvti3.c')
-rw-r--r-- | lib/builtins/addvti3.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/builtins/addvti3.c b/lib/builtins/addvti3.c index 79b9611f9..c224de60a 100644 --- a/lib/builtins/addvti3.c +++ b/lib/builtins/addvti3.c @@ -23,7 +23,7 @@ COMPILER_RT_ABI ti_int __addvti3(ti_int a, ti_int b) { - ti_int s = a + b; + ti_int s = (tu_int) a + (tu_int) b; if (b >= 0) { if (s < a) |