diff options
Diffstat (limited to 'src/common')
| -rw-r--r-- | src/common/parent_of_member.h | 3 | ||||
| -rw-r--r-- | src/common/tree.h | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/common/parent_of_member.h b/src/common/parent_of_member.h index e0f8ab5c8..58c70b0e7 100644 --- a/src/common/parent_of_member.h +++ b/src/common/parent_of_member.h | |||
| @@ -109,7 +109,8 @@ struct OffsetOfCalculator { | |||
| 109 | } | 109 | } |
| 110 | } | 110 | } |
| 111 | 111 | ||
| 112 | return (next - start) * sizeof(MemberType) + Offset; | 112 | return static_cast<ptrdiff_t>(static_cast<size_t>(next - start) * sizeof(MemberType) + |
| 113 | Offset); | ||
| 113 | } | 114 | } |
| 114 | 115 | ||
| 115 | static constexpr std::ptrdiff_t OffsetOf(MemberType ParentType::*member) { | 116 | static constexpr std::ptrdiff_t OffsetOf(MemberType ParentType::*member) { |
diff --git a/src/common/tree.h b/src/common/tree.h index 3da49e422..9d2d0df4e 100644 --- a/src/common/tree.h +++ b/src/common/tree.h | |||
| @@ -322,7 +322,7 @@ void RB_INSERT_COLOR(RBHead<Node>* head, Node* elm) { | |||
| 322 | template <typename Node> | 322 | template <typename Node> |
| 323 | void RB_REMOVE_COLOR(RBHead<Node>* head, Node* parent, Node* elm) { | 323 | void RB_REMOVE_COLOR(RBHead<Node>* head, Node* parent, Node* elm) { |
| 324 | Node* tmp; | 324 | Node* tmp; |
| 325 | while ((elm == nullptr || RB_IS_BLACK(elm)) && elm != head->Root()) { | 325 | while ((elm == nullptr || RB_IS_BLACK(elm)) && elm != head->Root() && parent != nullptr) { |
| 326 | if (RB_LEFT(parent) == elm) { | 326 | if (RB_LEFT(parent) == elm) { |
| 327 | tmp = RB_RIGHT(parent); | 327 | tmp = RB_RIGHT(parent); |
| 328 | if (RB_IS_RED(tmp)) { | 328 | if (RB_IS_RED(tmp)) { |