On Sun, Feb 13, 2011 at 09:21:13PM +0100, Guillaume Melquiond wrote: Hi Silene,
<snip> <snip personal insult> > So I repeat: it isn't safe to throw exceptions and thus skip the > cleanup code of the Lua engine. And guess what? Wesnoth wasn't doing > it, until you came. First I'm not sure what you're talking about, but I've a problem that the code of the VALIDATE macro is broken due to Lua. The code works properly in 1.4, works properly in 1.6, works properly 1.8, works properly in trunk r48229, except when Lua happens to be in the callstack. So the code works properly until it hits Lua, which seems to be not exception-safe. So you broke a working feature with the current Lua implementation and worse your changes also break the feature when there is no Lua in the callstack. VALIDATE was already in Wesnoth long before Lua was added, you broke it to make it work with Lua, please don't claim Wesnoth wasn't throwing exceptions Lua can't handle until I came around. Second it seems the current Lua implementation is not exception-safe. Which is a violation of our coding standards [1], quoting the relevant paragraph: <quote> Wesnoth code should be exception-safe, even if you do not use exceptions directly. That is, you should be able to assume that an exception is thrown almost anywhere from within the code, with well-defined results (i.e. no resource leaks). </quote> So you added a non-exception-safe code and now code breaks. This seems to be a good example why this rule was added to the coding standard: by adding non-exception-safe code you may suddenly break perfectly working code. It makes no sense to blame my code, somebody else might add another exception which breaks when Lua happens to be in the callstack. That code may not go through Lua now, but then suddenly might at some point in the future, as happened with the VALIDATE macro. <snip> > please fix all the bugs you have been introducing with GUI2! I've no idea why you want to bring up GUI2 bugs with regards to this Lua issue. The only connection I see is that at least one bug is hard to fix since Lua breaks VALIDATE. But please take your own advice and fix the Lua implementation so VALIDATE works again. [1] http://wiki.wesnoth.org/CodingStandards#Write_Exception-Safe_Code -- Regards, Mark de Wever aka Mordante/SkeletonCrew _______________________________________________ Wesnoth-dev mailing list [email protected] https://mail.gna.org/listinfo/wesnoth-dev
