mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
sysprof: ensure we add range to the bitset
We need to still call add, but we only want to do it when the added values are necessary. Otherwise we can get UB.
This commit is contained in:
@ -174,7 +174,12 @@ sysprof_normalized_series_items_changed (SysprofSeries *series,
|
||||
g_assert (G_IS_LIST_MODEL (model));
|
||||
|
||||
if (removed > 0 || added > 0)
|
||||
egg_bitset_splice (self->missing, position, removed, added);
|
||||
{
|
||||
egg_bitset_splice (self->missing, position, removed, added);
|
||||
|
||||
if (added > 0)
|
||||
egg_bitset_add_range (self->missing, position, added);
|
||||
}
|
||||
|
||||
if (removed > 0)
|
||||
g_array_remove_range (self->values, position, removed);
|
||||
|
||||
Reference in New Issue
Block a user