Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

* regcomp.c: Merge Onigmo 3d855b3.

  [Bug#6143] [Bug#6144] [Bug#6145]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35097 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
commit b2cc0976a7e167f47d3f71fb637af699950f15f9 1 parent 51f41bb
NARUSE, Yui nurse authored

Showing 4 changed files with 14 additions and 5 deletions. Show diff stats Hide diff stats

  1. +5 0 ChangeLog
  2. +1 1  regerror.c
  3. +3 3 regexec.c
  4. +5 1 regparse.c
5 ChangeLog
... ... @@ -1,3 +1,8 @@
  1 +Wed Mar 21 17:57:57 2012 NARUSE, Yui <naruse@ruby-lang.org>
  2 +
  3 + * regcomp.c: Merge Onigmo 3d855b30d574536d3ae600260208c6624ae4791c.
  4 + [Bug#6143] [Bug#6144] [Bug#6145]
  5 +
1 6 Wed Mar 21 17:01:55 2012 NAKAMURA Usaku <usa@ruby-lang.org>
2 7
3 8 * test/ruby/test_io.rb (TestIO#test_pos_with_getc): added.
2  regerror.c
@@ -116,7 +116,7 @@ onig_error_code_to_format(OnigPosition code)
116 116 case ONIGERR_INVALID_REPEAT_RANGE_PATTERN:
117 117 p = "invalid repeat range {lower,upper}"; break;
118 118 case ONIGERR_INVALID_CONDITION_PATTERN:
119   - p = "invalid condition pattern"; break;
  119 + p = "invalid conditional pattern"; break;
120 120 case ONIGERR_TOO_BIG_NUMBER:
121 121 p = "too big number"; break;
122 122 case ONIGERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE:
6 regexec.c
@@ -446,16 +446,16 @@ onig_region_copy(OnigRegion* to, OnigRegion* from)
446 446
447 447 #define STACK_INIT(alloc_addr, ptr_num, stack_num) do {\
448 448 if (msa->stack_p) {\
449   - alloc_addr = (char* )xalloca(sizeof(char*) * (ptr_num));\
  449 + alloc_addr = (char* )xalloca(sizeof(OnigStackIndex) * (ptr_num));\
450 450 stk_alloc = (OnigStackType* )(msa->stack_p);\
451 451 stk_base = stk_alloc;\
452 452 stk = stk_base;\
453 453 stk_end = stk_base + msa->stack_n;\
454 454 }\
455 455 else {\
456   - alloc_addr = (char* )xalloca(sizeof(char*) * (ptr_num)\
  456 + alloc_addr = (char* )xalloca(sizeof(OnigStackIndex) * (ptr_num)\
457 457 + sizeof(OnigStackType) * (stack_num));\
458   - stk_alloc = (OnigStackType* )(alloc_addr + sizeof(char*) * (ptr_num));\
  458 + stk_alloc = (OnigStackType* )(alloc_addr + sizeof(OnigStackIndex) * (ptr_num));\
459 459 stk_base = stk_alloc;\
460 460 stk = stk_base;\
461 461 stk_end = stk_base + (stack_num);\
6 regparse.c
@@ -5015,6 +5015,8 @@ parse_enclose(Node** np, OnigToken* tok, int term, UChar** src, UChar* end,
5015 5015 num = backs[0]; /* XXX: use left most named group as Perl */
5016 5016 }
5017 5017 #endif
  5018 + else
  5019 + return ONIGERR_INVALID_CONDITION_PATTERN;
5018 5020 *np = node_new_enclose(ENCLOSE_CONDITION);
5019 5021 CHECK_NULL_RETURN_MEMERR(*np);
5020 5022 NENCLOSE(*np)->regnum = num;
@@ -5975,7 +5977,8 @@ parse_exp(Node** np, OnigToken* tok, int term,
5975 5977 *np = node_new_cclass();
5976 5978 CHECK_NULL_RETURN_MEMERR(*np);
5977 5979 cc = NCCLASS(*np);
5978   - add_ctype_to_cc(cc, tok->u.prop.ctype, 0, 0, env);
  5980 + r = add_ctype_to_cc(cc, tok->u.prop.ctype, 0, 0, env);
  5981 + if (r != 0) return r;
5979 5982 if (tok->u.prop.not != 0) NCCLASS_SET_NOT(cc);
5980 5983 #ifdef USE_SHARED_CCLASS_TABLE
5981 5984 }
@@ -6005,6 +6008,7 @@ parse_exp(Node** np, OnigToken* tok, int term,
6005 6008
6006 6009 cc = NCCLASS(*np);
6007 6010 if (is_onechar_cclass(cc, &code)) {
  6011 + onig_node_free(*np);
6008 6012 *np = node_new_empty();
6009 6013 CHECK_NULL_RETURN_MEMERR(*np);
6010 6014 r = node_str_cat_codepoint(*np, env->enc, code);

0 comments on commit b2cc097

Please sign in to comment.
Something went wrong with that request. Please try again.