Fix "partly outside array bounds" warnings for GCC 12

master
Vitaliy Filippov 2024-01-15 03:03:28 +03:00
parent 45e6d1f131
commit 8de8b467ac
1 changed files with 3 additions and 3 deletions

View File

@ -574,9 +574,9 @@ class btree_node {
btree_node* child(int i) const { return fields_.children[i]; }
btree_node** mutable_child(int i) { return &fields_.children[i]; }
void set_child(int i, btree_node *c) {
*mutable_child(i) = c;
c->fields_.parent = this;
c->fields_.position = i;
reinterpret_cast<internal_fields*>(this)->children[i] = c;
reinterpret_cast<internal_fields*>(c)->parent = this;
reinterpret_cast<internal_fields*>(c)->position = i;
}
// Returns the position of the first value whose key is not less than k.