Skip to content

Code fails to clone container when it should #2

@lemire

Description

@lemire

When doing a binary operation between one bitmap and another, you sometimes take a reference to the containers from the second bitmap and add them as-the-are (without cloning) to the first bitmap. E.g., look at https://github.com/fzandona/goroar/blob/master/roaringbitmap.go#L169

The net result is that you end up with containers that belong to two bitmaps. This means that modifications to one bitmap will magically propagate to the other bitmap. That is probably not the desired effect.

I believe you should clone containers before adding them to another bitmap.

(I can submit a test case, but it is a design issue that is present through the code, not a one-off bug.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions