Choosing an Approach for the Template Lowering of _d_arrayctor

kinke noone at nowhere.com
Fri Nov 26 02:42:23 UTC 2021


On Thursday, 25 November 2021 at 19:58:11 UTC, Stanislav Blinov 
wrote:
> I'm just not expressing myself clearly :) This won't be a 
> compile error. The `emplaceInitializer` above would plop a null 
> context pointer into `it`, which, if the destructor actually 
> accesses context, naturally would lead to a segfault in 
> __ArrayDtor.

Note that this is exactly the current behavior of 
intimately-related .dup for non-POD slices: 
https://github.com/dlang/druntime/blob/595707b1ac8a439b2a7243b0abf95d4bc56239ff/src/object.d#L3601-L3627


More information about the Digitalmars-d mailing list