Skip to content

Commit

Permalink
* regcomp.c: Merge Onigmo 3d855b30d574536d3ae600260208c6624ae4791c.
Browse files Browse the repository at this point in the history
  [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
nurse committed Mar 21, 2012
1 parent 51f41bb commit b2cc097
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
@@ -1,3 +1,8 @@
Wed Mar 21 17:57:57 2012 NARUSE, Yui <naruse@ruby-lang.org>

* regcomp.c: Merge Onigmo 3d855b30d574536d3ae600260208c6624ae4791c.
[Bug#6143] [Bug#6144] [Bug#6145]

Wed Mar 21 17:01:55 2012 NAKAMURA Usaku <usa@ruby-lang.org>

* test/ruby/test_io.rb (TestIO#test_pos_with_getc): added.
Expand Down
2 changes: 1 addition & 1 deletion regerror.c
Expand Up @@ -116,7 +116,7 @@ onig_error_code_to_format(OnigPosition code)
case ONIGERR_INVALID_REPEAT_RANGE_PATTERN:
p = "invalid repeat range {lower,upper}"; break;
case ONIGERR_INVALID_CONDITION_PATTERN:
p = "invalid condition pattern"; break;
p = "invalid conditional pattern"; break;
case ONIGERR_TOO_BIG_NUMBER:
p = "too big number"; break;
case ONIGERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE:
Expand Down
6 changes: 3 additions & 3 deletions regexec.c
Expand Up @@ -446,16 +446,16 @@ onig_region_copy(OnigRegion* to, OnigRegion* from)

#define STACK_INIT(alloc_addr, ptr_num, stack_num) do {\
if (msa->stack_p) {\
alloc_addr = (char* )xalloca(sizeof(char*) * (ptr_num));\
alloc_addr = (char* )xalloca(sizeof(OnigStackIndex) * (ptr_num));\
stk_alloc = (OnigStackType* )(msa->stack_p);\
stk_base = stk_alloc;\
stk = stk_base;\
stk_end = stk_base + msa->stack_n;\
}\
else {\
alloc_addr = (char* )xalloca(sizeof(char*) * (ptr_num)\
alloc_addr = (char* )xalloca(sizeof(OnigStackIndex) * (ptr_num)\
+ sizeof(OnigStackType) * (stack_num));\
stk_alloc = (OnigStackType* )(alloc_addr + sizeof(char*) * (ptr_num));\
stk_alloc = (OnigStackType* )(alloc_addr + sizeof(OnigStackIndex) * (ptr_num));\
stk_base = stk_alloc;\
stk = stk_base;\
stk_end = stk_base + (stack_num);\
Expand Down
6 changes: 5 additions & 1 deletion regparse.c
Expand Up @@ -5015,6 +5015,8 @@ parse_enclose(Node** np, OnigToken* tok, int term, UChar** src, UChar* end,
num = backs[0]; /* XXX: use left most named group as Perl */
}
#endif
else
return ONIGERR_INVALID_CONDITION_PATTERN;
*np = node_new_enclose(ENCLOSE_CONDITION);
CHECK_NULL_RETURN_MEMERR(*np);
NENCLOSE(*np)->regnum = num;
Expand Down Expand Up @@ -5975,7 +5977,8 @@ parse_exp(Node** np, OnigToken* tok, int term,
*np = node_new_cclass();
CHECK_NULL_RETURN_MEMERR(*np);
cc = NCCLASS(*np);
add_ctype_to_cc(cc, tok->u.prop.ctype, 0, 0, env);
r = add_ctype_to_cc(cc, tok->u.prop.ctype, 0, 0, env);
if (r != 0) return r;
if (tok->u.prop.not != 0) NCCLASS_SET_NOT(cc);
#ifdef USE_SHARED_CCLASS_TABLE
}
Expand Down Expand Up @@ -6005,6 +6008,7 @@ parse_exp(Node** np, OnigToken* tok, int term,

cc = NCCLASS(*np);
if (is_onechar_cclass(cc, &code)) {
onig_node_free(*np);
*np = node_new_empty();
CHECK_NULL_RETURN_MEMERR(*np);
r = node_str_cat_codepoint(*np, env->enc, code);
Expand Down

0 comments on commit b2cc097

Please sign in to comment.