Bug 22970 – importC: taking address one past array end gives bounds error

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-04-02T20:53:06Z
Last change time
2022-04-05T06:43:54Z
Keywords
ImportC, pull, rejects-valid
Assigned to
No Owner
Creator
duser

Comments

Comment #0 by duser — 2022-04-02T20:53:06Z
int xs[5]; void fn() { for (int *p = &xs[0]; p < &xs[5]; p++) ; } Error: array index 5 is out of bounds `[0..5]`
Comment #1 by dlang-bot — 2022-04-04T07:42:21Z
@WalterBright created dlang/dmd pull request #13945 "fix Issue 22970 - importC: taking address one past array end gives bo…" fixing this issue: - fix Issue 22970 - importC: taking address one past array end gives bounds error https://github.com/dlang/dmd/pull/13945
Comment #2 by dlang-bot — 2022-04-05T06:43:54Z
dlang/dmd pull request #13945 "fix Issue 22970 - importC: taking address one past array end gives bo…" was merged into master: - 5f3ff498206df0439c1df79074f958bef777cd2f by Walter Bright: fix Issue 22970 - importC: taking address one past array end gives bounds error https://github.com/dlang/dmd/pull/13945