Edata: zero stack edatas before initializing.
This avoids some UB. No compilers take advantage of it for now, but no sense in tempting fate.
This commit is contained in:
committed by
David Goldblatt
parent
5dead37a9d
commit
eda9c2858f
@@ -247,7 +247,7 @@ emap_split_prepare(tsdn_t *tsdn, emap_t *emap, emap_prepare_t *prepare,
|
||||
* and commit state, and head status. This is a fake edata_t, used to
|
||||
* facilitate a lookup.
|
||||
*/
|
||||
edata_t lead;
|
||||
edata_t lead = {0};
|
||||
edata_init(&lead, 0U, edata_addr_get(edata), size_a, false, 0, 0,
|
||||
extent_state_active, false, false, false, EXTENT_NOT_HEAD);
|
||||
|
||||
|
@@ -198,7 +198,7 @@ extent_alloc_dss(tsdn_t *tsdn, arena_t *arena, void *new_addr, size_t size,
|
||||
*commit = pages_decommit(ret, size);
|
||||
}
|
||||
if (*zero && *commit) {
|
||||
edata_t edata;
|
||||
edata_t edata = {0};
|
||||
ehooks_t *ehooks = arena_get_ehooks(
|
||||
arena);
|
||||
|
||||
|
Reference in New Issue
Block a user