Thread overview
[Issue 24157] [REG2.105] class `this` as lvalue leads to memory corruption
Sep 25, 2023
kinke
Sep 28, 2023
Dlang Bot
Nov 01, 2023
Dlang Bot
Nov 23, 2023
RazvanN
Nov 27, 2023
anonymous4
September 25, 2023
https://issues.dlang.org/show_bug.cgi?id=24157

--- Comment #1 from kinke <kinke@gmx.net> ---
Interestingly, this does NOT return a ref (the correct thing to do - the `this` class ref is passed in a CPU register):

```
class Promise {
  auto ref unshared() {
    return this;
  }
}
```

--
September 28, 2023
https://issues.dlang.org/show_bug.cgi?id=24157

--- Comment #2 from Dlang Bot <dlang-bot@dlang.rocks> ---
@kinke created dlang/dmd pull request #15637 "Revert "fix Issue 24024 - cannot pass class this to ref class"" mentioning this issue:

- Add test case for Issue 24157 - [REG2.105] class `this` as lvalue leads to memory corruption

https://github.com/dlang/dmd/pull/15637

--
November 01, 2023
https://issues.dlang.org/show_bug.cgi?id=24157

--- Comment #3 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/dmd pull request #15637 "[stable] Revert "fix Issue 24024 - cannot pass class this to ref class"" was merged into stable:

- a88677ace1b9e3f925c332b7ad10d2ac095e6c09 by Martin Kinkelin:
  Add test case for Issue 24157 - [REG2.105] class `this` as lvalue leads to
memory corruption

https://github.com/dlang/dmd/pull/15637

--
November 23, 2023
https://issues.dlang.org/show_bug.cgi?id=24157

RazvanN <razvan.nitu1305@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |razvan.nitu1305@gmail.com
         Resolution|---                         |FIXED

--- Comment #4 from RazvanN <razvan.nitu1305@gmail.com> ---
Fixed by: https://github.com/dlang/dmd/pull/15637

--
November 27, 2023
https://issues.dlang.org/show_bug.cgi?id=24157

anonymous4 <dfj1esp02@sneakemail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://issues.dlang.org/sh
                   |                            |ow_bug.cgi?id=24024

--