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.
Comment #1 by dlang-bot — 2023-05-25T01:18:00Z
@ljmf00 created dlang/dmd pull request #15266 "constfold: multiplication should check for overflow" fixing this issue:
- constfold: multiplication should check for overflow
Fixes issue 23934.
Signed-off-by: Luís Ferreira <[email protected]>
https://github.com/dlang/dmd/pull/15266
Comment #2 by robert.schadek — 2024-12-13T19:29:14Z