Skip to content

integer arithmetic overflow #855

Closed
Closed
@StefanKarpinski

Description

@StefanKarpinski

To deal with integer arithmetic overflow we do the following:

  1. add checked integer arithmetic intrinsics named checked_add, checked_mul, etc.
  2. have a compiler switch that uses these everywhere.
  3. write a @check_overflow macro that transforms an expression to turn * into checked_mul and + into checked_add, etc., but only in the expression — called functions are on their own.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions