Skip to content

BinaryHeap integer overflow with ZST? #149448

@theemathas

Description

@theemathas

I found this comment in the standard library, indicating that BinaryHeap can have an integer overflow with a large collection of ZSTs. This should probably be fixed.

// FIXME: 2 * hole.pos() + 1 or 2 * hole.pos() + 2 could overflow
// if T is a ZST

Metadata

Metadata

Assignees

Labels

A-ZSTArea: Zero-sized types (ZSTs).A-collectionsArea: `std::collections`C-bugCategory: This is a bug.T-libsRelevant to the library team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions