June 21, 2005 exception not caught | ||||
---|---|---|---|---|
| ||||
Stumbled over the following bug: # import std.stdio; # int bb[char[]]; # void main() # { # foreach(char[] s, int i; bb) # writef(); // This never gets called, but the bug goes away if it # // is exchanged with eg. {} # # bb["a"] = 1; # # foreach(int b; bb) # try throw new Error("foo"); # catch(Error e) # // BUG: The exception isn't caught # {writefln("Caught error ", e);} # } Exchanging the writef() with {} or another simple function call removes the bug. Removing the "char[] s" loop variable or any of the foreach statements also does the trick. Nick (using 0.127 on linux) |
June 22, 2005 Re: exception not caught | ||||
---|---|---|---|---|
| ||||
Posted in reply to Nick | -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Nick schrieb am Tue, 21 Jun 2005 17:22:42 +0000 (UTC): > Stumbled over the following bug: > > # import std.stdio; > # int bb[char[]]; > # void main() > # { > # foreach(char[] s, int i; bb) > # writef(); // This never gets called, but the bug goes away if it > # // is exchanged with eg. {} > # > # bb["a"] = 1; > # > # foreach(int b; bb) > # try throw new Error("foo"); > # catch(Error e) > # // BUG: The exception isn't caught > # {writefln("Caught error ", e);} > # } > > Exchanging the writef() with {} or another simple function call removes the bug. Removing the "char[] s" loop variable or any of the foreach statements also does the trick. > > Nick (using 0.127 on linux) Added to DStress as http://dstress.kuehne.cn/run/c/catch_05_A.d http://dstress.kuehne.cn/run/c/catch_05_B.d http://dstress.kuehne.cn/run/c/catch_05_C.d http://dstress.kuehne.cn/run/c/catch_05_E.d http://dstress.kuehne.cn/run/c/catch_05_F.d http://dstress.kuehne.cn/run/c/catch_05_G.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFCuaHh3w+/yD4P9tIRAkMcAJ40m1F9rekzJ3aqXeLd260HrOjKcgCeLGSe zJK71T2mNTohssHHgqTWi8g= =8565 -----END PGP SIGNATURE----- |
Copyright © 1999-2021 by the D Language Foundation