Bug in RefCounted?

Maxim Fomin maxim at maxim-fomin.ru
Tue Oct 29 08:53:40 PDT 2013


On Tuesday, 29 October 2013 at 11:46:53 UTC, Rene Zwanenburg 
wrote:
>
> That's pretty nasty :). But I suspect this is a bug and not by 
> design. __dtor and __traits are, IMHO, the proverbial escape 
> hatch D should provide, so I think that's OK. I take it that by 
> control flow trick you mean the try/catch example in your other 
> post?
>

By control flow tricks I mean follows: compiler inserts dtor 
invocation in the end the function for stack structs and static 
arrays of struct, so in theory one way to call dtor twice is to 
jump multiple times just before dtor call, using for example 
gotos, exceptions or such obscure feature as C setjmp/longjump.



More information about the Digitalmars-d-learn mailing list