aboutsummaryrefslogtreecommitdiffstats
path: root/regexec.c
Commit message (Collapse)AuthorAgeFilesLines
* Add default cases for cache point finding functionTSUYUSATO Kitsune2022-11-171-34/+60
|
* Add OP_CCLASS_MB caseTSUYUSATO Kitsune2022-11-171-0/+1
|
* Reduce warningsTSUYUSATO Kitsune2022-11-091-10/+8
|
* Use long instead of intTSUYUSATO Kitsune2022-11-091-15/+15
|
* Check for integer overflow in the allocation of match_cache tableYusuke Endoh2022-11-091-0/+4
|
* Ensure that the table size for CACHE_MATCH fits with intYusuke Endoh2022-11-091-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 warningsYusuke Endoh2022-11-091-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_optYusuke Endoh2022-11-091-7/+9
|
* Revert "Refactor field names"TSUYUSATO Kitsune2022-11-091-147/+156
| | | | This reverts commit 1e6673d6bbd2adbf555d82c7c0906ceb148ed6ee.
* Refactor field namesTSUYUSATO Kitsune2022-11-091-156/+147
|
* Remove debug printfTSUYUSATO Kitsune2022-11-091-12/+0
|
* Clear cache on OP_NULL_CHECK_END_MEMSTTSUYUSATO Kitsune2022-11-091-17/+95
|
* Support OP_REPEAT and OP_REPEAT_INCTSUYUSATO Kitsune2022-11-091-38/+180
|
* Reduce warningsTSUYUSATO Kitsune2022-11-091-26/+6
|
* Fix to compile when USE_CACHE_MATCH_OPT is disabledTSUYUSATO Kitsune2022-11-091-7/+29
|
* Enable optimization for PUSH_IF/OR opcodesTSUYUSATO Kitsune2022-11-091-0/+2
|
* Enable optimization for ANYCHAR_STAR opcodesTSUYUSATO Kitsune2022-11-091-0/+4
|
* Add index to the latest NULL_CHECK_STACK for fast matchingTSUYUSATO Kitsune2022-11-091-4/+17
|
* Add static declaration to new functionsTSUYUSATO Kitsune2022-11-091-3/+3
|
* Increment num_fail on OP_POP tooTSUYUSATO Kitsune2022-11-091-4/+15
|
* Fix look-around like operators and cclassTSUYUSATO Kitsune2022-11-091-43/+25
|
* Keep cache optimization info to MatchArg for global matchingTSUYUSATO Kitsune2022-11-091-35/+26
|
* Implement cache optimization for regexp matchingTSUYUSATO Kitsune2022-11-091-1/+468
|
* re.c: Add Regexp.timeout= and Regexp.timeoutYusuke Endoh2022-03-301-0/+2
| | | | [Feature #17837]
* Fix multiplex backreferencs near end of string in regexp matchJeremy Evans2022-03-291-2/+4
| | | | | | Idea from Jirka Marsik. Fixes [Bug #18631]
* regint.h: Reduce the frequency of rb_thread_check_intsYusuke Endoh2022-03-241-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 backtrackJeremy Evans2022-03-101-0/+1
| | | | | | Fixes [Bug #14103] Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
* Fixed shorten-64-to-32 errors when USE_COMBINATION_EXPLOSION_CHECKNobuyoshi Nakada2021-05-071-4/+4
|
* Only define history_root member of the Oniguruma re_registers struct if ↵Lourens Naudé2019-04-241-0/+2
| | | | USE_CAPTURE_HISTORY is enabled
* label as lvalue is a GCCismshyouhei2018-01-021-3/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* re-apply r60755naruse2017-12-011-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.naruse2017-12-011-20/+25
| | | | | | [Bug #13892] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* regexec.c: invalidate previously matched positionnobu2017-11-131-0/+1
| | | | | | | | * regexec.c (match_at): invalidate end position not yet matched when new start position is pushed, to dispose previously stored position. [ruby-core:83743] [Bug #14101] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60755 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Merge Onigmo 6.1.1naruse2017-02-111-33/+124
| | | | | | | * Support absent operator https://github.com/k-takata/Onigmo/issues/82 * https://github.com/k-takata/Onigmo/blob/Onigmo-6.1.1/HISTORY git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Merge Onigmo 6.0.0naruse2016-12-101-445/+450
| | | | | | | | | | | * https://github.com/k-takata/Onigmo/blob/Onigmo-6.0.0/HISTORY * fix for ruby 2.4: https://github.com/k-takata/Onigmo/pull/78 * suppress warning: https://github.com/k-takata/Onigmo/pull/79 * include/ruby/oniguruma.h: include onigmo.h. * template/encdb.h.tmpl: ignore duplicated definition of EUC-CN in enc/euc_kr.c. It is defined in enc/gb2313.c with CRuby macro. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57045 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * regexec.c (OPCODE_EXEC_HOOK): op is p-1 because p is alreadynaruse2016-10-031-9/+13
| | | | | | | | | | | incremented. * regexec.c (OPCODE_EXEC_HOOK): use the exact end address. * regexec.c (match_at): don't call OPCODE_EXEC_HOOK in CASE() when it comes from goto fail. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56332 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * regexec.c (ONIGENC_IS_MBC_ASCII_WORD): redefine optimized one.naruse2016-05-291-0/+12
| | | | | | WORD of Ruby's ascii compatible encoding is always [a-zA-Z0-9_]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55203 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * regexec.c (match_at): make compilers optimize harder.naruse2016-05-291-6/+7
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* regexec.c: constifynobu2016-04-241-1/+1
| | | | | | * regexec.c (match_at): constify oplabels. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* regexec.c: fix build with direct threaded VMnobu2015-12-221-187/+191
| | | | | | | | * regexec.c (match_at): move direct threaded VM code to get rid of mixed declarations and code, and enable it only for gcc since it depends on a gcc extension. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53251 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* regexec.c: enable direct threaded VMnobu2015-12-221-0/+4
| | | | | | | * regexec.c (USE_DIRECT_THREADED_VM): enable direct threaded VM by the default. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53248 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * remove trailing spaces.svn2015-11-261-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52757 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * regcomp.c, regenc.c, regexec.c, regint.h, enc/unicode.c:naruse2015-11-261-298/+424
| | | | | | | Merge Onigmo 58fa099ed1a34367de67fb3d06dd48d076839692 + https://github.com/k-takata/Onigmo/pull/52 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52756 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* uninitialized variablenobu2014-12-261-1/+2
| | | | | | | | | | | * process.c (rb_spawn_process): get rid of usage of uninitialized variable. reported by Denis Denisov <denji0k AT gmail.com>. * regexec.c (match_at): ditto. * ext/win32ole/win32ole.c (ole_wc2mb_alloc, ole_vstr2wc, ole_mb2wc): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49025 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix printf format conversion specifiersnobu2014-12-261-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * reg*.c: Merge Onigmo 5.15.0 38a870960aa7370051a3544naruse2014-09-151-3/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * regcomp.c: Merge Onigmo 5.14.1 25a8a69fc05ae3b56a09.naruse2014-07-161-30/+51
| | | | | | this includes Support for Unicode 7.0 [Bug #9092]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46831 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* constify rb_encoding and OnigEncodingnobu2014-06-011-1/+1
| | | | | | | * include/ruby/encoding.h: constify `rb_encoding` arguments. * include/ruby/oniguruma.h: constify `OnigEncoding` arguments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46309 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * Merge Onigmo 5.13.4 f22cf2e566712cace60d17f84d63119d7c5764ee.naruse2013-04-131-5/+4
| | | | | | [bug] fix problem with optimization of \z (Issue #16) [Bug #8210] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40276 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * Merge Onigmo d4bad41e16e3eccd97ccce6f1f96712e557c4518.naruse2013-03-111-3/+6
| | | | | | | fix lookbehind assertion fails with /m mode enabled. [Bug #8023] fix \Z matches where it shouldn't. [Bug #8001] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39718 b2dd03c8-39d4-4d8f-98ff-823fe69b080e