Skip to content

Potential violation of strict weak ordering in ProcessSet.h #2260

@bbiiggppiigg

Description

@bbiiggppiigg

Another potential bug reported by AI scanning.

On the following two lines

bool operator<(const write_t &w) { return (addr < w.addr) && (size < w.size) && (buffer < w.buffer); }

and

bool operator<(const read_t &w) { return (addr < w.addr) && (size < w.size) && (buffer < w.buffer); }

, the operator <'s returns true only if all three comparison holds. So if there is ever a case where a.addr > b.addr but b.size > a.size => a < b and b< a both won't hold and will be treated as equivalent if ever put into a STL container.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions