Bug 23679 – off-by-one error for static array size limit

Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2023-02-07T20:35:40Z
Last change time
2023-02-13T03:29:15Z
Keywords
pull
Assigned to
No Owner
Creator
kdevel

Comments

Comment #0 by kdevel — 2023-02-07T20:35:40Z
$ dmd --version DMD64 D Compiler v2.102.0 Copyright (C) 1999-2023 by The D Language Foundation, All Rights Reserved written by Walter Bright $ cat sizlim.d unittest { ubyte [0x7fff_ffffU] arr; assert (true); } $ dmd -unittest -main -run sizlim.d sizlim.d(2): Error: `ubyte[2147483647]` size 1 * 2147483647 exceeds 0x7fffffff size limit for static array Apart from that, shouldn't the wording and the position of the numerical limit be "... exceeds the size limit <limit> for static arrays."
Comment #1 by dlang-bot — 2023-02-07T20:58:36Z
@dkorpel created dlang/dmd pull request #14867 "Fix 23679 - off-by-one error for static array size limit" fixing this issue: - Fix 23679 - off-by-one error for static array size limit https://github.com/dlang/dmd/pull/14867
Comment #2 by dlang-bot — 2023-02-08T07:50:24Z
dlang/dmd pull request #14867 "Fix 23679 - off-by-one error for static array size limit" was merged into stable: - 321d4a17f231683e7d01b50661b4e8ccba8e239f by Dennis Korpel: Fix 23679 - off-by-one error for static array size limit https://github.com/dlang/dmd/pull/14867
Comment #3 by dlang-bot — 2023-02-13T03:29:15Z
dlang/dmd pull request #14875 "merge stable" was merged into master: - f08dd665d4e951a95757836a58329531122b0469 by Dennis: Fix 23679 - off-by-one error for static array size limit (#14867) https://github.com/dlang/dmd/pull/14875