DMD-0.164 regressions

Thomas Kuehne thomas-dloop at kuehne.cn
Fri Aug 18 00:12:04 PDT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Walter Bright schrieb am 2006-08-17:
> class_26_A and class_26_B are invalid code. Both return a delegate that 
> relies on the stack frame of foo() existing, but the delegate is called 
> after foo() has exited.
>
>
> More technically,
>
>      1. dg contains the 'this' pointer for the instance of class C
>      2. the instance of class C contains a member that is the frame 
> pointer for the stack instance of foo()
>      3. the stack instance of foo() contains a frame pointer for the 
> stack instance of main()
>
> dg(), to get at main.status, has to walk back through 1, 2 and 3. After 
> foo() has exited, (2) points to garbage, and so cannot get a correct 
> value for (3), and failure ensues.
>
> This will be an excellent test case when D implements the ability for 
> delegates to 'escape', but that won't be for 1.0.

Thanks, fixed

Thomas


-----BEGIN PGP SIGNATURE-----

iD8DBQFE5QXeLK5blCcjpWoRArRiAKCA8GFyIPwujy0eJyZCYv5XH1U5OwCfakhB
m2EUUkreSHB6ZEzytvUaReA=
=mObr
-----END PGP SIGNATURE-----



More information about the Digitalmars-d-bugs mailing list