November 12 [Issue 24855] New: VRP fails to prevent overflow after division | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=24855 Issue ID: 24855 Summary: VRP fails to prevent overflow after division Product: D Version: D2 Hardware: All OS: All Status: NEW Keywords: accepts-invalid Severity: minor Priority: P1 Component: dmd Assignee: nobody@puremagic.com Reporter: dkorpel@live.nl Found by IchorDev: https://forum.dlang.org/reply/emmuvvrfaeplqkjufkch@forum.dlang.org ``` void f() { short x = short.max; short div = 1; short y = x / div + 1; } ``` Expected behavior: Error that expression `x / div + 1` can't implicitly convert to short. Actual behavior: compiles without error. -- |
Copyright © 1999-2021 by the D Language Foundation