This commit is contained in:
Jonathan Wakely 2017-12-07 14:37:10 +00:00
parent fe6c381304
commit b7843aa77e
2 changed files with 37 additions and 2 deletions

View File

@ -0,0 +1,28 @@
From 9687dea689e58cd1f67440fa529cb5c9692e9858 Mon Sep 17 00:00:00 2001
From: Avi Kivity <avi@scylladb.com>
Date: Sun, 2 Jul 2017 12:56:35 +0300
Subject: [PATCH] Fix undefined behavior in interval_bounds::reverse_right()
The ~ operator converts _bits from unsigned char to int, and makes it
negative to boot. Shifting left a negative number is undefined behavior.
Cast it back to unsigned char to prevent undefined behavior.
---
include/boost/icl/interval_bounds.hpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/boost/icl/interval_bounds.hpp b/include/boost/icl/interval_bounds.hpp
index edf16d0..f917cb6 100644
--- a/include/boost/icl/interval_bounds.hpp
+++ b/include/boost/icl/interval_bounds.hpp
@@ -41,8 +41,8 @@ class interval_bounds
interval_bounds all ()const { return interval_bounds(_bits & _all ); }
interval_bounds left ()const { return interval_bounds(_bits & _left ); }
interval_bounds right()const { return interval_bounds(_bits & _right); }
- interval_bounds reverse_left ()const { return interval_bounds((~_bits>>1) & _right); }
- interval_bounds reverse_right()const { return interval_bounds((~_bits<<1) & _left ); }
+ interval_bounds reverse_left ()const { return interval_bounds((bound_type(~_bits)>>1) & _right); }
+ interval_bounds reverse_right()const { return interval_bounds((bound_type(~_bits)<<1) & _left ); }
bound_type bits()const{ return _bits; }

View File

@ -35,7 +35,7 @@ Name: boost
Summary: The free peer-reviewed portable C++ source libraries
Version: 1.63.0
%global version_enc 1_63_0
Release: 9%{?dist}
Release: 10%{?dist}
License: Boost and MIT and Python
%global toplev_dirname %{name}_%{version_enc}
@ -143,6 +143,10 @@ Patch86: boost-1.63.0-icl-ttp-matching.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1421784
Patch87: boost-1.63.0-asio-ssl.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1516837
# https://github.com/boostorg/icl/pull/11
Patch88: boost-1.64.0-icl-undefined-shift.patch
%bcond_with tests
%bcond_with docs_generated
@ -761,7 +765,7 @@ find ./boost -name '*.hpp' -perm /111 | xargs chmod a-x
%patch83 -p1
%patch84 -p1
%patch86 -p2
%patch87 -p2
%patch88 -p2
# At least python2_version needs to be a macro so that it's visible in
# %%install as well.
@ -1555,6 +1559,9 @@ fi
%{_mandir}/man1/bjam.1*
%changelog
* Thu Dec 07 2017 Jonathan Wakely <jwakely@redhat.com> - 1.63.0-10
- Patch to fix #1516837
* Mon Sep 25 2017 Jonathan Wakely <jwakely@redhat.com> - 1.63.0-9
- Patch asio so header is self-contained (#1421784)
- Fix some rpmlint issues: