D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 22970 - importC: taking address one past array end gives bounds error
Summary: importC: taking address one past array end gives bounds error
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 normal
Assignee: No Owner
URL:
Keywords: ImportC, pull, rejects-valid
Depends on:
Blocks:
 
Reported: 2022-04-02 20:53 UTC by duser
Modified: 2022-04-05 06:43 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description duser 2022-04-02 20:53:06 UTC
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 Dlang Bot 2022-04-04 07:42:21 UTC
@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 Dlang Bot 2022-04-05 06:43:54 UTC
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