digitalmars.D.bugs - Big bug with scope() in nested { }
- BCS (15/15) Sep 23 2006 This *is* a bug. Has it been reported yet?
- BCS (2/2) Sep 23 2006 forgot to mention
- Mikola Lysenko (6/26) Sep 24 2006 Probably a new discovery. This is related to the try-catch bug that has...
- BCS (4/10) Sep 24 2006 Likely this is related, but both of them only mention cases where delega...
- Mikola Lysenko (12/16) Sep 25 2006 From what I've worked out, it appears to be an issue with the way the
This *is* a bug. Has it been reported yet? <code> import std.stdio; void main() { { scope(exit) writef("a\n"); } scope(exit) writef("b\n"); } <code> output: a b b
Sep 23 2006
BCS wrote:This *is* a bug. Has it been reported yet? <code> import std.stdio; void main() { { scope(exit) writef("a\n"); } scope(exit) writef("b\n"); } <code> output: a b bProbably a new discovery. This is related to the try-catch bug that has been around since DMD 0.150. So far, no fix. Here are the relevant posts: http://lists.puremagic.com/pipermail/digitalmars-d-bugs/2006-May/000854.html http://lists.puremagic.com/pipermail/digitalmars-d-bugs/2006-August/001911.html Hopefully they will get fixed soon.
Sep 24 2006
== Quote from Mikola Lysenko (mclysenk mtu.edu)'s articleProbably a new discovery. This is related to the try-catch bug that has been around since DMD 0.150. So far, no fix. Here are the relevant posts: http://lists.puremagic.com/pipermail/digitalmars-d-bugs/2006-May/000854.html http://lists.puremagic.com/pipermail/digitalmars-d-bugs/2006-August/001911.html Hopefully they will get fixed soon.Likely this is related, but both of them only mention cases where delegates are used, How does mine create a delegate? (From the scope statement?) OTOH is this bug known to cause problems elsewhere? (I didn't read then whole thread)
Sep 24 2006
BCS wrote:Likely this is related, but both of them only mention cases where delegates are used, How does mine create a delegate? (From the scope statement?) OTOH is this bug known to cause problems elsewhere? (I didn't read then whole thread)From what I've worked out, it appears to be an issue with the way the compiler calculates offsets for things like catch and finally blocks in general. The delegates are just one case of this bug. Whenever there is more than one set of scope exit blocks, the bug will manifest. It appears to be because the compiler does not properly compute the offsets in one of the DHandler structs (though the exact details escape me at the moment, since it has been a few months since I spent any time wrestling with this problem.) It is a rather aggravating problem, which took me several hours of single stepping through the asm from deh2.d to figure out what was going. I certainly hope it gets fixed in the next release.
Sep 25 2006