Thread overview | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
November 01, 2016 [Issue 16652] [Reg 2.071] returned rvalue destroyed too early | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=16652 Martin Nowak <code@dawg.eu> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|returned rvalue gets |[Reg 2.071] returned rvalue |destroyed before |destroyed too early |expressions ends | Severity|major |regression --- Comment #1 from Martin Nowak <code@dawg.eu> --- Turns out this is actually a regression introduced by https://github.com/dlang/dmd/pull/5292. Also here is the test case with an assertion instead of writeln. cat > bug.d << CODE struct Vector { this(ubyte a) { buf[] = a; } ubyte[] opSlice() { return buf[]; } ~this() { buf[] = 0; } ubyte[4] buf; } void bar(ubyte[] v) { assert(v[0] == 1); } void main() { bar(Vector(1)[]); } CODE dmd -inline -run bug -- |
November 01, 2016 [Issue 16652] [Reg 2.071] returned rvalue destroyed too early | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=16652 Ketmar Dark <ketmar@ketmar.no-ip.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ketmar@ketmar.no-ip.org -- |
May 19, 2017 [Issue 16652] [Reg 2.071] returned rvalue destroyed too early | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=16652 Walter Bright <bugzilla@digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bugzilla@digitalmars.com See Also| |https://issues.dlang.org/sh | |ow_bug.cgi?id=17399 -- |
December 14, 2018 [Issue 16652] [Reg 2.071] returned rvalue destroyed too early | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=16652 --- Comment #2 from Walter Bright <bugzilla@digitalmars.com> --- A further reduction: struct Vector { this(ubyte a) { pragma(inline, false); buf = a; } ~this() { pragma(inline, false); buf = 0; } ubyte buf; } void bar(ubyte* v) { pragma(inline, true); assert(*v == 1); } void main() { bar(&Vector(1).buf); } It's the inlining of bar() that elicits the bug. -- |
December 14, 2018 [Issue 16652] [Reg 2.071] returned rvalue destroyed too early | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=16652 --- Comment #3 from Walter Bright <bugzilla@digitalmars.com> --- (In reply to Walter Bright from comment #2) > It's the inlining of bar() that elicits the bug. Looking at the AST for main() without inlining: _D4test3barFPhZv call (dctor info ((__slVecto3 = 0) , (Vector.ctor call (1 param &__slVecto3)))); ddtor (Vector.dtor call &__slVecto); 0L ; and it looks correct. With inlining: v = (dctor info ((__slVecto3 = 0) , (Vector.ctor call (1 param &__slVecto3)))); ddtor (Vector.dtor call &__slVecto3); (*v == 1) || (_d_assertp call (19L param #__a6_746573742e64)); 0L ; and the destructor call is clearly too soon. -- |
December 15, 2018 [Issue 16652] [Reg 2.071] returned rvalue destroyed too early | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=16652 --- Comment #4 from Walter Bright <bugzilla@digitalmars.com> --- https://github.com/dlang/dmd/pull/9081 -- |
December 16, 2018 [Issue 16652] [Reg 2.071] returned rvalue destroyed too early | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=16652 --- Comment #5 from github-bugzilla@puremagic.com --- Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/535e8a4f47393fda584d315718833e504f4e69e7 fix Issue 16652 - [Reg 2.071] returned rvalue destroyed too early https://github.com/dlang/dmd/commit/040320dbb881961ed1f00b4eac39f67400af1d02 Merge pull request #9081 from WalterBright/fix16652 fix Issue 16652 - [Reg 2.071] returned rvalue destroyed too early -- |
December 16, 2018 [Issue 16652] [Reg 2.071] returned rvalue destroyed too early | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=16652 github-bugzilla@puremagic.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |FIXED -- |
Copyright © 1999-2021 by the D Language Foundation