Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Fix regex match cache out-of-bounds access | Alan Wu | 2023-11-16 | 1 | -1/+1 |
| | | | | | | | | | | Previously the following read and wrote 1 byte out-of-bounds: $ valgrind ruby -e 'p /(\W+)[bx]\?/i.match? "aaaaaa aaaaaaaaa aaaa aaaaaaaa aaa aaaaxaaaaaaaaaaa aaaaa aaaaaaaaaaaa a ? aaa aaaa a ?"' 2> >(grep Invalid -A 30) Because of the `match_cache_point_index + 1` in memoize_extended_match_cache_point() and check_extended_match_cache_point(), we need one more byte of space. | ||||
* | Optimize regexp matching for look-around and atomic groups (#7931) | Hiroya Fujinami | 2023-10-30 | 1 | -151/+224 |
| | |||||
* | Add function rb_reg_onig_match | Peter Zhu | 2023-07-27 | 1 | -2/+6 |
| | | | | | | rb_reg_onig_match performs preparation, error handling, and cleanup for matching a regex against a string. This reduces repetitive code and removes the need for StringScanner to access internal data of regex. | ||||
* | Don't check for null pointer in calls to free | Peter Zhu | 2023-06-30 | 1 | -12/+12 |
| | | | | | | | | According to the C99 specification section 7.20.3.2 paragraph 2: > If ptr is a null pointer, no action occurs. So we do not need to check that the pointer is a null pointer. | ||||
* | Allow the match cache optimization for atomic groups (#7804) | TSUYUSATO Kitsune | 2023-05-22 | 1 | -0/+4 |
| | |||||
* | Remove warnings and errors in `regexec.c` with `ONIG_DEBUG_...` macros (#7803) | TSUYUSATO Kitsune | 2023-05-13 | 1 | -3/+3 |
| | |||||
* | Delay start of the match cache optimization (#7738) | TSUYUSATO Kitsune | 2023-05-04 | 1 | -9/+16 |
| | |||||
* | Refactor `Regexp#match` cache implementation (#7724) | TSUYUSATO Kitsune | 2023-04-19 | 1 | -311/+408 |
| | | | | | | | | | | * Refactor Regexp#match cache implementation Improved variable and function names Fixed [Bug 19537] (Maybe fixed in https://github.com/ruby/ruby/pull/7694) * Add a comment of the glossary for "match cache" * Skip to reset match cache when no cache point on null check | ||||
* | Fix `PLATFORM_GET_INC` | Nobuyoshi Nakada | 2023-04-16 | 1 | -1/+1 |
| | | | | | | | | On platforms where unaligned word access is not allowed, and if `sizeof(val)` and `sizeof(type)` differ: - `val` > `type`, `val` will be a garbage. - `val` < `type`, outside `val` will be clobbered. | ||||
* | [Bug #19587] Fix `reset_match_cache` arguments | Nobuyoshi Nakada | 2023-04-12 | 1 | -1/+1 |
| | |||||
* | Constify | Nobuyoshi Nakada | 2023-04-12 | 1 | -6/+6 |
| | |||||
* | Extract `bsearch_cache_index` function | Nobuyoshi Nakada | 2023-04-12 | 1 | -21/+18 |
| | |||||
* | [Bug #19476]: correct cache index computation for repetition (#7457) | TSUYUSATO Kitsune | 2023-03-13 | 1 | -2/+2 |
| | |||||
* | [Bug #19467] correct cache points and counting failure on ↵ | TSUYUSATO Kitsune | 2023-03-13 | 1 | -4/+16 |
| | | | | `OP_ANYCHAR_STAR_PEEK_NEXT` (#7454) | ||||
* | Fix [Bug 19273], set correct value to `outer_repeat` on `OP_REPEAT` (#7035) | TSUYUSATO Kitsune | 2022-12-28 | 1 | -1/+1 |
| | |||||
* | Adjust style [ci skip] | Nobuyoshi Nakada | 2022-12-22 | 1 | -6/+13 |
| | |||||
* | Add `Regexp.linear_time?` (#6901) | TSUYUSATO Kitsune | 2022-12-14 | 1 | -1/+15 |
| | |||||
* | Make absent operator work at the end of the input string | Yusuke Endoh | 2022-12-12 | 1 | -0/+5 |
| | | | | https://bugs.ruby-lang.org/issues/19104#change-100542 | ||||
* | Add default cases for cache point finding function | TSUYUSATO Kitsune | 2022-11-17 | 1 | -34/+60 |
| | |||||
* | Add OP_CCLASS_MB case | TSUYUSATO Kitsune | 2022-11-17 | 1 | -0/+1 |
| | |||||
* | Reduce warnings | TSUYUSATO Kitsune | 2022-11-09 | 1 | -10/+8 |
| | |||||
* | Use long instead of int | TSUYUSATO Kitsune | 2022-11-09 | 1 | -15/+15 |
| | |||||
* | Check for integer overflow in the allocation of match_cache table | Yusuke Endoh | 2022-11-09 | 1 | -0/+4 |
| | |||||
* | Ensure that the table size for CACHE_MATCH fits with int | Yusuke Endoh | 2022-11-09 | 1 | -1/+1 |
| | | | | | Currently, the keys for CACHE_MATCH are handled as an `int` type. So we should make sure the table size are smaller than the range of `int`. | ||||
* | Prevent GCC warnings | Yusuke Endoh | 2022-11-09 | 1 | -4/+4 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ``` regexec.c: In function ‘reset_match_cache’: regexec.c:1259:56: warning: suggest parentheses around ‘-’ inside ‘<<’ [-Wparentheses] 1259 | match_cache[k1 >> 3] &= ((1 << (8 - (k2 & 7) - 1)) - 1 << ((k2 & 7) + 1)) | ((1 << (k1 & 7)) - 1); | ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~ regexec.c:1269:60: warning: suggest parentheses around ‘-’ inside ‘<<’ [-Wparentheses] 1269 | match_cache[k2 >> 3] &= ((1 << (8 - (k2 & 7) - 1)) - 1 << ((k2 & 7) + 1)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~ regexec.c: In function ‘find_cache_index_table’: regexec.c:1192:11: warning: ‘m’ may be used uninitialized [-Wmaybe-uninitialized] 1192 | if (!(0 <= m && m < num_cache_table && table[m].addr == p)) { | ~~^~~~ regexec.c: In function ‘match_at’: regexec.c:1238:12: warning: ‘m1’ is used uninitialized [-Wuninitialized] 1238 | if (table[m1].addr < pbegin && m1 + 1 < num_cache_table) m1++; | ^ regexec.c:1218:39: note: ‘m1’ was declared here 1218 | int l = 0, r = num_cache_table - 1, m1, m2; | ^~ regexec.c:1239:12: warning: ‘m2’ is used uninitialized [-Wuninitialized] 1239 | if (table[m2].addr > pend && m2 - 1 > 0) m2--; | ^ regexec.c:1218:43: note: ‘m2’ was declared here 1218 | int l = 0, r = num_cache_table - 1, m1, m2; | ^~ ``` | ||||
* | Return ONIGERR_MEMORY if it fails to allocate memory for cache_match_opt | Yusuke Endoh | 2022-11-09 | 1 | -7/+9 |
| | |||||
* | Revert "Refactor field names" | TSUYUSATO Kitsune | 2022-11-09 | 1 | -147/+156 |
| | | | | This reverts commit 1e6673d6bbd2adbf555d82c7c0906ceb148ed6ee. | ||||
* | Refactor field names | TSUYUSATO Kitsune | 2022-11-09 | 1 | -156/+147 |
| | |||||
* | Remove debug printf | TSUYUSATO Kitsune | 2022-11-09 | 1 | -12/+0 |
| | |||||
* | Clear cache on OP_NULL_CHECK_END_MEMST | TSUYUSATO Kitsune | 2022-11-09 | 1 | -17/+95 |
| | |||||
* | Support OP_REPEAT and OP_REPEAT_INC | TSUYUSATO Kitsune | 2022-11-09 | 1 | -38/+180 |
| | |||||
* | Reduce warnings | TSUYUSATO Kitsune | 2022-11-09 | 1 | -26/+6 |
| | |||||
* | Fix to compile when USE_CACHE_MATCH_OPT is disabled | TSUYUSATO Kitsune | 2022-11-09 | 1 | -7/+29 |
| | |||||
* | Enable optimization for PUSH_IF/OR opcodes | TSUYUSATO Kitsune | 2022-11-09 | 1 | -0/+2 |
| | |||||
* | Enable optimization for ANYCHAR_STAR opcodes | TSUYUSATO Kitsune | 2022-11-09 | 1 | -0/+4 |
| | |||||
* | Add index to the latest NULL_CHECK_STACK for fast matching | TSUYUSATO Kitsune | 2022-11-09 | 1 | -4/+17 |
| | |||||
* | Add static declaration to new functions | TSUYUSATO Kitsune | 2022-11-09 | 1 | -3/+3 |
| | |||||
* | Increment num_fail on OP_POP too | TSUYUSATO Kitsune | 2022-11-09 | 1 | -4/+15 |
| | |||||
* | Fix look-around like operators and cclass | TSUYUSATO Kitsune | 2022-11-09 | 1 | -43/+25 |
| | |||||
* | Keep cache optimization info to MatchArg for global matching | TSUYUSATO Kitsune | 2022-11-09 | 1 | -35/+26 |
| | |||||
* | Implement cache optimization for regexp matching | TSUYUSATO Kitsune | 2022-11-09 | 1 | -1/+468 |
| | |||||
* | re.c: Add Regexp.timeout= and Regexp.timeout | Yusuke Endoh | 2022-03-30 | 1 | -0/+2 |
| | | | | [Feature #17837] | ||||
* | Fix multiplex backreferencs near end of string in regexp match | Jeremy Evans | 2022-03-29 | 1 | -2/+4 |
| | | | | | | Idea from Jirka Marsik. Fixes [Bug #18631] | ||||
* | regint.h: Reduce the frequency of rb_thread_check_ints | Yusuke Endoh | 2022-03-24 | 1 | -0/+2 |
| | | | | | | | edc8576a65b7082597d45a694434261ec3ac0d9e checks interrupt at every backtrack, which brought significant overhead. This change makes the check only once every 128 backtracks. | ||||
* | Allow interrupting regexps that backtrack | Jeremy Evans | 2022-03-10 | 1 | -0/+1 |
| | | | | | | Fixes [Bug #14103] Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org> | ||||
* | Fixed shorten-64-to-32 errors when USE_COMBINATION_EXPLOSION_CHECK | Nobuyoshi Nakada | 2021-05-07 | 1 | -4/+4 |
| | |||||
* | Only define history_root member of the Oniguruma re_registers struct if ↵ | Lourens Naudé | 2019-04-24 | 1 | -0/+2 |
| | | | | USE_CAPTURE_HISTORY is enabled | ||||
* | label as lvalue is a GCCism | shyouhei | 2018-01-02 | 1 | -3/+2 |
| | | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e | ||||
* | re-apply r60755 | naruse | 2017-12-01 | 1 | -0/+1 |
| | | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60969 b2dd03c8-39d4-4d8f-98ff-823fe69b080e | ||||
* | Update to Onigmo 6.1.3-669ac9997619954c298da971fcfacccf36909d05. | naruse | 2017-12-01 | 1 | -20/+25 |
| | | | | | | [Bug #13892] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e |