* regexec.c (match_at): make compilers optimize harder.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2016-05-29 13:56:38 +00:00
Родитель b9e392fbed
Коммит 9ff5f9c071
2 изменённых файлов: 11 добавлений и 6 удалений

Просмотреть файл

@ -1,3 +1,7 @@
Sun May 29 22:44:19 2016 NARUSE, Yui <naruse@ruby-lang.org>
* regexec.c (match_at): make compilers optimize harder.
Sun May 29 12:08:42 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/-test-/auto_ext.rb (auto_ext): utitily method to create

Просмотреть файл

@ -1561,9 +1561,6 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
mem_start_stk = (OnigStackIndex* )(repeat_stk + reg->num_repeat);
mem_end_stk = mem_start_stk + (num_mem + 1);
for (i = 0; i <= num_mem; i++) {
mem_start_stk[i] = mem_end_stk[i] = INVALID_STACK_INDEX;
}
#else /* USE_SUBEXP_CALL */
/* Stack #0 not is used. */
n = reg->num_repeat + reg->num_mem * 2;
@ -1579,10 +1576,14 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
mem_start_stk[1]..mem_start_stk[num_mem] */
mem_end_stk--; /* for index start from 1,
mem_end_stk[1]..mem_end_stk[num_mem] */
for (i = 1; i <= num_mem; i++) {
mem_start_stk[i] = mem_end_stk[i] = INVALID_STACK_INDEX;
}
#endif /* USE_SUBEXP_CALL */
{
OnigStackIndex *pp = mem_start_stk;
for (; pp < (repeat_stk + n); pp+=2) {
pp[0] = INVALID_STACK_INDEX;
pp[1] = INVALID_STACK_INDEX;
}
}
#ifdef ONIG_DEBUG_MATCH
fprintf(stderr, "match_at: str: %"PRIdPTR" (%p), end: %"PRIdPTR" (%p), start: %"PRIdPTR" (%p), sprev: %"PRIdPTR" (%p)\n",