[MacRuby] #612: RegexpError: too short escaped multibyte character
#612: RegexpError: too short escaped multibyte character ---------------------------------+------------------------------------------ Reporter: cehoffman@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ---------------------------------+------------------------------------------ Introduced in r3459 it seems that regular expressions that use escape codes fail with a RegexpError. MacRuby r3459 {{{ $ macruby -e "p MACRUBY_REVISION; Regexp.compile('[^\0-\177]')" "git commit b078cfc15060a60cdd72f7764d9c3809bfc1427a" -e:1:in `<main>': too short escaped multibyte character: /[^\0-\177]/ (RegexpError) }}} MacRuby r3458 {{{ $ macruby -e "p MACRUBY_REVISION; Regexp.compile('[^\0-\177]'))" "git commit 2311cf7d47b64218069fde17de290d75034a0fa3" }}} Ruby 1.9.1 {{{ $ ruby -e "p RUBY_VERSION; Regexp.compile('[^\0-\177]')" "1.9.1" }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/612> MacRuby <http://macruby.org/>
#612: RegexpError: too short escaped multibyte character ---------------------------------+------------------------------------------ Reporter: cehoffman@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ---------------------------------+------------------------------------------ Comment(by cehoffman@…): These changes are specifically the ones that bring up the RegexpError. {{{ diff --git a/array.c b/array.c index c4f7e7f..7cf2d4a 100644 --- a/array.c +++ b/array.c @@ -2887,11 +2887,12 @@ rary_sample(VALUE ary, SEL sel, int argc, VALUE *argv) memmove(&sorted[j+1], &sorted[j], sizeof(sorted[0])*(i-j)); sorted[j] = idx[i] = k; } - VALUE *elems = (VALUE *)alloca(sizeof(VALUE) * n); + VALUE *elems = (VALUE *)malloc(sizeof(VALUE) * n); for (i = 0; i < n; i++) { elems[i] = RARRAY_AT(ary, idx[i]); } result = rb_ary_new4(n, elems); + free(elems); } else { VALUE *elems = (VALUE *)malloc(sizeof(VALUE) * n); }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/612#comment:1> MacRuby <http://macruby.org/>
#612: RegexpError: too short escaped multibyte character ---------------------------------+------------------------------------------ Reporter: cehoffman@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ---------------------------------+------------------------------------------ Comment(by lsansonetti@…): It looks like the re.c bug is haunting us again. Let's hope it will disappear forever once we merge the new string/regexp. -- Ticket URL: <http://www.macruby.org/trac/ticket/612#comment:2> MacRuby <http://macruby.org/>
#612: RegexpError: too short escaped multibyte character ---------------------------------+------------------------------------------ Reporter: cehoffman@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ---------------------------------+------------------------------------------ Comment(by martinlagardette@…): Should we close this bug? We have plenty of bug report about errors from re.c with `too short escaped` etc. or `premature end of char-class`, and they should be fixed when we have the new string/regexp -- Ticket URL: <http://www.macruby.org/trac/ticket/612#comment:3> MacRuby <http://macruby.org/>
Probably a good idea to close it *after* the new string/regexp is done and we've proven that it actually solves the problem, or at least have a reasonably good idea that it does. :) - Jordan On Feb 10, 2010, at 3:45 AM, MacRuby wrote:
Should we close this bug? We have plenty of bug report about errors from re.c with `too short escaped` etc. or `premature end of char-class`, and they should be fixed when we have the new string/regexp
#612: RegexpError: U_REGEX_BAD_ESCAPE_SEQUENCE ---------------------------------+------------------------------------------ Reporter: cehoffman@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ---------------------------------+------------------------------------------ Comment(by lsansonetti@…): The snippet above now causes the following error on trunk: {{{ $ ./miniruby -e "p MACRUBY_REVISION; Regexp.compile('[^\0-\177]')" "svn revision 3849 from http://svn.macosforge.org/repository/ruby/MacRuby/trunk" /Users/lrz/src/macruby-trunk/-e:1:in `<main>': regexp `[^\0-\177] 'compilation error: U_REGEX_BAD_ESCAPE_SEQUENCE (RegexpError) }}} This error comes from ICU. Renamed the title accordingly. -- Ticket URL: <http://www.macruby.org/trac/ticket/612#comment:4> MacRuby <http://macruby.org/>
#612: RegexpError: U_REGEX_BAD_ESCAPE_SEQUENCE ---------------------------------+------------------------------------------ Reporter: cehoffman@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ---------------------------------+------------------------------------------ Comment(by lsansonetti@…): Also happens with: {{{
macruby -e "p /\0/" -e:1: regexp `\0 'compilation error: U_REGEX_BAD_ESCAPE_SEQUENCE }}}
<rdar://problem/7942071> -- Ticket URL: <http://www.macruby.org/trac/ticket/612#comment:5> MacRuby <http://macruby.org/>
#612: RegexpError: U_REGEX_BAD_ESCAPE_SEQUENCE ---------------------------------+------------------------------------------ Reporter: cehoffman@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: blocker | Milestone: MacRuby 0.7 Component: MacRuby | Resolution: fixed Keywords: | ---------------------------------+------------------------------------------ Changes (by lsansonetti@…): * status: new => closed * resolution: => fixed * milestone: => MacRuby 0.7 Comment: This should be fixed in r4042. I didn't test all the cases but it should work. -- Ticket URL: <http://www.macruby.org/trac/ticket/612#comment:6> MacRuby <http://macruby.org/>
participants (2)
-
Jordan K. Hubbard
-
MacRuby