Skip to content

Commit ced952d

Browse files
Fix overflow in range lock (alibaba#973) (alibaba#974) (alibaba#975)
Co-authored-by: Eric <qingxiang.hqx@alibaba-inc.com>
1 parent a6fe522 commit ced952d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

common/range-lock.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ limitations under the License.
1818
#include <cinttypes>
1919
#include <set>
2020
#include <photon/thread/thread.h>
21+
#include <photon/common/utility.h>
2122

2223
class RangeLock
2324
{
@@ -118,7 +119,7 @@ class RangeLock
118119
}
119120
uint64_t end() const
120121
{
121-
return offset + length;
122+
return photon::sat_add(offset, length);
122123
}
123124
bool operator < (const range_t& rhs) const
124125
{

0 commit comments

Comments
 (0)