Ensure there are no overflows #14

Open
opened 2025-08-12 06:36:05 -06:00 by sashakoshka · 0 comments
Owner

We commonly uint64 to int so that Go functions related to allocation and iteration know what they mean, which could cause unexpected behavior when reading in bad data or even good data. We need to make a safe cast function that either returns a value or an error if the value can't be casted—for every cast we make that loses data. At the end of this, there should be no casts which are capable of losing data.

Also, look into tooling that checks for casts automatically.

This should be distinct from the limits defined in #2 , but these systems should both be in place for redundancy.

We commonly uint64 to int so that Go functions related to allocation and iteration know what they mean, which could cause unexpected behavior when reading in bad data or even good data. We need to make a safe cast function that either returns a value or an error if the value can't be casted—for every cast we make that loses data. At the end of this, there should be no casts which are capable of losing data. Also, look into tooling that checks for casts automatically. This should be distinct from the limits defined in #2 , but these systems should both be in place for redundancy.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sashakoshka/hopp#14
No description provided.