mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-10-31 15:20:10 +00:00
cpp-btreee: Fix alloc/dealloc size mismatch (struct padding)
Between new_leaf_node and delete_leaf_node This is mostly harmless, but triggers AddressSanitizer When alignof(value_type) is less than alignof(base_fields) and kNodeValues * sizeof(value_type) is not an integral multiple of alignof(base_fields), such that leaf_fields has padding
This commit is contained in:
parent
c8817d7f4e
commit
6be4708131
3
src/3rdparty/cpp-btree/btree.h
vendored
3
src/3rdparty/cpp-btree/btree.h
vendored
@ -1281,7 +1281,8 @@ class btree : public Params::key_compare {
|
||||
}
|
||||
node_type* new_leaf_node(node_type *parent) {
|
||||
leaf_fields *p = reinterpret_cast<leaf_fields*>(
|
||||
mutable_internal_allocator()->allocate(sizeof(leaf_fields)));
|
||||
mutable_internal_allocator()->allocate(
|
||||
sizeof(base_fields) + kNodeValues * sizeof(value_type)));
|
||||
return node_type::init_leaf(p, parent, kNodeValues);
|
||||
}
|
||||
node_type* new_leaf_root_node(int max_count) {
|
||||
|
Loading…
Reference in New Issue
Block a user