Age | Commit message (Collapse) | Author |
|
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.
|
|
|
|
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.
Notes:
Merged: https://github.com/ruby/ruby/pull/8123
|
|
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.
Notes:
Merged: https://github.com/ruby/ruby/pull/8004
|
|
Notes:
Merged-By: makenowjust <[email protected]>
|
|
Notes:
Merged-By: makenowjust <[email protected]>
|
|
Notes:
Merged-By: makenowjust <[email protected]>
|
|
* 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
Notes:
Merged-By: makenowjust <[email protected]>
|
|
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.
Notes:
Merged: https://github.com/ruby/ruby/pull/7723
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/7694
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/7694
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/7694
|
|
Notes:
Merged-By: makenowjust <[email protected]>
|
|
`OP_ANYCHAR_STAR_PEEK_NEXT` (#7454)
Notes:
Merged-By: makenowjust <[email protected]>
|
|
Notes:
Merged-By: makenowjust <[email protected]>
|
|
|
|
Notes:
Merged-By: makenowjust <[email protected]>
|
|
https://bugs.ruby-lang.org/issues/19104#change-100542
Notes:
Merged: https://github.com/ruby/ruby/pull/6902
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/6744
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/6744
|
|
|
|
|
|
|
|
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`.
|
|
```
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;
| ^~
```
|
|
|
|
This reverts commit 1e6673d6bbd2adbf555d82c7c0906ceb148ed6ee.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Feature #17837]
Notes:
Merged: https://github.com/ruby/ruby/pull/5703
|
|
Idea from Jirka Marsik.
Fixes [Bug #18631]
Notes:
Merged: https://github.com/ruby/ruby/pull/5710
|
|
edc8576a65b7082597d45a694434261ec3ac0d9e checks interrupt at every
backtrack, which brought significant overhead.
This change makes the check only once every 128 backtracks.
Notes:
Merged: https://github.com/ruby/ruby/pull/5697
|
|
Fixes [Bug #14103]
Co-authored-by: Nobuyoshi Nakada <[email protected]>
Notes:
Merged: https://github.com/ruby/ruby/pull/4960
|
|
|
|
USE_CAPTURE_HISTORY is enabled
|
|
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60969 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
[Bug #13892]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|