Bug 20890 – parameter corruption when other parameter is a static array of length 1
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2020-06-01T19:51:44Z
Last change time
2020-06-02T05:11:26Z
Keywords
pull, wrong-code
Assigned to
No Owner
Creator
Basile-z
Comments
Comment #0 by b2.temp — 2020-06-01T19:51:44Z
example must run without assertion failure
---
void format(string spec, S[1] s)
{
assert(spec.length);
}
struct S {}
void main()
{
S[1] s;
format("lengthy", s);
}
---
this is a DMD backend regression caused by https://github.com/dlang/dmd/pull/9357.
full bisection report:
> digger: Clearing temporary cache
> digger: ---------------------- Running test command... -----------------------
> digger: ------------- Test command exited with status -11 (BAD). -------------
> digger: Finding shortest path between 054b8cd7b68d32ac134e52c1e8cfb54210b6484e > and 27c7650e74799e0f796116f9cc734c365ab3ecf0...
> digger: 0 commits (about 0 tests) remaining.
> digger: 27c7650e74799e0f796116f9cc734c365ab3ecf0 is the first bad commit
> commit 27c7650e74799e0f796116f9cc734c365ab3ecf0
> Author: Sebastian Wilzbach <[email protected]>
> Date: Thu Feb 14 00:01:34 2019 +0100
>
> dmd: Merge pull request #9357 from WalterBright/fix19672
>
> https://github.com/dlang/dmd/pull/9357
>
> fix Issue 19672 - Function uses the stack to read a static array para…
>
> diff --git a/dmd b/dmd
> index 73fcf82ae..c2c6b4b6e 160000
> --- a/dmd
> +++ b/dmd
> @@ -1 +1 @@
> -Subproject commit 73fcf82ae1d6f0582c19e8c2ae0d09f319745521
> +Subproject commit c2c6b4b6eaa4f80db2292f8c2ecf2cd250367e72
> digger: Bisection completed successfully.
Comment #1 by dlang-bot — 2020-06-01T21:09:09Z
@NilsLankila created dlang/dmd pull request #11207 "fix issue 20890 - parameter corruption when other parameter is a stat…" fixing this issue:
- fix issue 20890 - parameter corruption when other parameter is a static array of length 1
https://github.com/dlang/dmd/pull/11207
Comment #2 by dlang-bot — 2020-06-02T05:11:26Z
dlang/dmd pull request #11207 "fix issue 20890 - parameter corruption when other parameter is a stat…" was merged into stable:
- 5a597997bd4d6194320f05be93754321dc05fdf9 by Nils Lankila:
fix issue 20890 - parameter corruption when other parameter is a static array of length 1
https://github.com/dlang/dmd/pull/11207