Fix "partly outside array bounds" warnings for GCC 12
parent
45e6d1f131
commit
8de8b467ac
6
btree.h
6
btree.h
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue