Weird bug in std.logger? Possible memory corruption

Christian Köstlin christian.koestlin at gmail.com
Wed Nov 1 17:26:42 UTC 2023


On Wednesday, 1 November 2023 at 14:15:55 UTC, matheus wrote:
> On Tuesday, 31 October 2023 at 21:19:34 UTC, Arafel wrote:
>> ...
>>
>> Assigning the value to a variable works as expected:
>>
>> ```d
>> import std.logger : info;
>>
>> void main() {
>>     auto s = foo();
>>     info(s);
>> }
>>
>> auto foo() {
>>     info("In foo");
>>     return "Hello, world.";
>> }
>> ```
>> ...
>
> Unless you do:
>
>     string s;
>     info(s=foo());
>
> I think this is a bug, or at least very weird behavior.
>
> Matheus.
It's really weird: https://run.dlang.io/is/fIBR2n



More information about the Digitalmars-d-learn mailing list