[Issue 23934] New: Literal integer multiplication overflow is allowed in CTFE

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed May 24 12:03:36 UTC 2023


https://issues.dlang.org/show_bug.cgi?id=23934

          Issue ID: 23934
           Summary: Literal integer multiplication overflow is allowed in
                    CTFE
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: eyal at weka.io

This example program generates the following assertion failure:

  static assert(1000*1000*1000*1000 > 0); // Error: static assert:  `-727379968
> 0` is false

It would detect bugs earlier if constant-folding/CTFE execution of
multiplication disallowed overflow.

--


More information about the Digitalmars-d-bugs mailing list