entt icon indicating copy to clipboard operation
entt copied to clipboard

Sparse set cross range-erase can break when using built-in iterators

Open xissburg opened this issue 3 years ago • 4 comments
trafficstars

I am encountering a weird issue where I have a set with (0x8, 0x100009) for example, and I call entt::sparse_set::erase with a set which contains (0x100009) and the result is the set (0x100009), where the set (0x8) is expected.

Repro https://godbolt.org/z/P8ezsKrfT

xissburg avatar Jul 31 '22 19:07 xissburg

I think you're right. I tried to optimize the pop function a little too much. 😅 The nice thing is that branch v3.10.1 and wip also have a divergence, so I'll have to fix it twice! 😭 Good catch btw, I'll confirm it asap but I'm pretty sure you found a corner cases that isn't covered by a test (and also provided the latter, which is good ❤️).

skypjack avatar Aug 01 '22 07:08 skypjack

I've created a new tag, v3.10.2 - it would be great if you could test it and confirm that the issue is gone. There are a bunch of tests to verify it and avoid regressions, so I'm pretty confident. Just a double check. 🙂

skypjack avatar Aug 01 '22 08:08 skypjack

Also solved on wip in the meantime. 👍

skypjack avatar Aug 01 '22 09:08 skypjack

~~I strongly suspect it's not fixed yet, shame on me. 🤔~~

Also the storage suffers from the same issue. I'm creating a new issue to track it and spawning a new patch release in a row.

skypjack avatar Aug 02 '22 06:08 skypjack

Fixed in release (v3.10.2).

skypjack avatar Aug 02 '22 12:08 skypjack