From: SourceForge.net <no...@so...> - 2007-03-01 17:36:05
|
Patches item #1458247, was opened at 2006-03-25 12:55 Message generated for change (Comment added) made by harlequin_ You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=301645&aid=1458247&group_id=1645 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Henrik Hinrichs (harlequin_) Assigned to: Nobody/Anonymous (nobody) Summary: [ruby] Problems with director:except Initial Comment: We've got the following problem with %feature(director:except) in ruby the director_method_rescue function can only be called once, if an error occurs. Take the following generated function: VALUE CombatController_notifyActionStart_rescue(VALUE args, VALUE error) { if (CombatController_notifyActionStart_call_depth == 1) // Director except code { int status = -1; rb_eval_string_protect("print $!", &status); Throw(rl::ScriptInvocationFailedException, string("A Script exception occured. ") + StringValuePtr(error) ); } // End director except code CombatController_notifyActionStart_call_depth--; rb_exc_raise(error); } if the first call fails, because the _call_depth is 1, the _call_depth is not deincremated, all following calls will lead to rb_exc_raise(error); which destroys our embedded ruby_interpreter. To prevent this, i added _call_depth-- before the director except code, so that subsequent calls will still lead to a correct exception. ---------------------------------------------------------------------- >Comment By: Henrik Hinrichs (harlequin_) Date: 2007-03-01 18:36 Message: Logged In: YES user_id=1485678 Originator: YES This bug still is in swig 1.3.1. All _rescue-Functions with activated %feature("director:except") will have this problem. If an error occurs in the ruby-part of any Director-Method, the first time everything goes well. depthCount is 1 in the rescue-function, and the code given in "director:except" will be executed. But this code will throw an exception, so the depthCount-- at the end of the rescue-function will never be executed. So the next time, the director method fails, at the beginning of the rescue-function depthCount is 2, where it should be 1. So no custom director:except-Code will be executed, and the ruby exception out of ruby scope will lead to a crash. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=301645&aid=1458247&group_id=1645 |