#1076: Abort occurs when raise a SecurityError within Thread. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: blocker | Milestone: MacRuby 0.9 Component: MacRuby | Resolution: fixed Keywords: | ----------------------------------+----------------------------------------- Comment(by lsansonetti@…): This patch should re-implement r5099, however I'm having a ruby spec failure (apparently in rational), so I will commit the patch once I'm sure it does not break anything. {{{ Index: array.c =================================================================== --- array.c (revision 5193) +++ array.c (working copy) @@ -1805,9 +1805,15 @@ VALUE *t = p; VALUE *end = p + RARY(ary)->len; + bool check_modify = true; + if (use_equal) { while (t < end) { if (RTEST(rb_equal_fast(*t, item))) { + if (check_modify) { + rary_modify(ary); + check_modify = false; + } t++; } else { @@ -1820,6 +1826,10 @@ else { while (t < end) { if (*t == item) { + if (check_modify) { + rary_modify(ary); + check_modify = false; + } t++; } else { @@ -1842,7 +1852,6 @@ VALUE rary_delete(VALUE ary, SEL sel, VALUE item) { - rary_modify(ary); const bool changed = rary_delete_element(ary, item, true); if (!changed) { if (rb_block_given_p()) { @@ -2835,7 +2844,6 @@ static VALUE rary_compact_bang(VALUE ary, SEL sel) { - rary_modify(ary); return rary_delete_element(ary, Qnil, false) ? ary : Qnil; } }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/1076#comment:8> MacRuby <http://macruby.org/>