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/subvdi3.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/subvdi3.c')
-rw-r--r-- | lib/builtins/subvdi3.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/builtins/subvdi3.c b/lib/builtins/subvdi3.c index 0f1f924ef..71fc70ffa 100644 --- a/lib/builtins/subvdi3.c +++ b/lib/builtins/subvdi3.c @@ -21,7 +21,7 @@ COMPILER_RT_ABI di_int __subvdi3(di_int a, di_int b) { - di_int s = a - b; + di_int s = (du_int) a - (du_int) b; if (b >= 0) { if (s > a) |