dearblue
dde5fe3a60
Reduce RVALUE related pointer casts.
2024-02-04 21:55:53 +09:00
Yukihiro "Matz" Matsumoto
f04a729dc9
gc.c (obj_free): check if irep is NULL before mrb_irep_decref(); #6161
2024-02-04 17:06:05 +09:00
Yukihiro "Matz" Matsumoto
2f63b49542
backtrace.c: use mrb_irep references instead of struct RProc
...
To reduce GC burden (no mark needed). We use `mrb_irep_incref()` and
`mrb_irep_decref()` instead to track irep memory usage; ref #6161
2024-02-04 16:48:42 +09:00
Yukihiro "Matz" Matsumoto
4dfadb4f9f
Merge pull request #6159 from dearblue/debug/irep-free
...
Allow to detect use-after-free after `mrb_irep_free()` for debugging
2024-02-04 16:26:03 +09:00
Yukihiro "Matz" Matsumoto
0abc36f761
Merge pull request #6161 from dearblue/backtrace
...
Fixed use-after-free by backtrace object
2024-02-03 23:39:58 +09:00
Yukihiro "Matz" Matsumoto
9524d8e199
Merge pull request #6164 from jbampton/remove-ERROR_ON_MISSING_EXEC_BIT
...
super-linter: remove `ERROR_ON_MISSING_EXEC_BIT` check
2024-02-03 00:25:35 +09:00
John Bampton
8e04e76325
super-linter: remove ERROR_ON_MISSING_EXEC_BIT check
...
https://github.com/super-linter/super-linter/releases/tag/v6.0.0
https://github.com/super-linter/super-linter/pull/5120
2024-02-02 15:51:18 +10:00
Yukihiro "Matz" Matsumoto
08c422c7ee
numeric.c (cmpnum): support fixnum cmp bignum; fix #6163
2024-02-02 14:18:57 +09:00
Yukihiro "Matz" Matsumoto
4762689f93
Merge pull request #6153 from dearblue/gem-list
...
Make `MRuby::Gems::List#{each,<<}` method return `self`
2024-02-02 08:19:44 +09:00
Yukihiro "Matz" Matsumoto
fd04ffc2f6
Merge pull request #6144 from jbampton/add-hook-detect-aws-credentials
...
pre-commit: add hook `detect-aws-credentials`
2024-02-02 08:15:38 +09:00
Yukihiro "Matz" Matsumoto
6e09555749
Merge pull request #6150 from dearblue/itself
...
Introduce `mrb_obj_itself()`
2024-02-01 16:15:42 +09:00
Yukihiro "Matz" Matsumoto
24aad706e1
Merge pull request #6162 from mruby/dependabot/github_actions/super-linter/super-linter-6.0.0
...
build(deps): bump super-linter/super-linter from 5.7.2 to 6.0.0
2024-02-01 16:02:45 +09:00
dependabot[bot]
a0bcf63bd5
build(deps): bump super-linter/super-linter from 5.7.2 to 6.0.0
...
Bumps [super-linter/super-linter](https://github.com/super-linter/super-linter ) from 5.7.2 to 6.0.0.
- [Release notes](https://github.com/super-linter/super-linter/releases )
- [Changelog](https://github.com/super-linter/super-linter/blob/main/CHANGELOG.md )
- [Commits](https://github.com/super-linter/super-linter/compare/v5.7.2...v6.0.0 )
---
updated-dependencies:
- dependency-name: super-linter/super-linter
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com >
2024-01-31 14:23:26 +00:00
dearblue
9543cfa7ee
Fixed use-after-free by backtrace object
...
The `MRB_TT_BACKTRACE` object has been added for the purpose.
Previously, "use-after-free" could occur because the reference count in `backtrace_location::irep` was not incremented.
fixed #6160
2024-01-31 22:17:16 +09:00
Yukihiro "Matz" Matsumoto
cac698fe88
string.c (memsearch_swar): changed the function name
...
For your information, SWAR stands for SIMD within a register.
2024-01-31 21:37:39 +09:00
Yukihiro "Matz" Matsumoto
f8527f0670
string.c (mrb_memsearch_ss): update a comment regarding alignment issue
2024-01-31 21:36:05 +09:00
Yukihiro "Matz" Matsumoto
d8144aef78
string.c: remove a comment regarding unsigned char*
2024-01-31 21:34:54 +09:00
Yukihiro "Matz" Matsumoto
363f795432
string.c: remove unnecessary type casts
...
We don't need `unsigned` for string pointers.
2024-01-31 15:06:04 +09:00
Yukihiro "Matz" Matsumoto
e61a2881a7
string.c (mrb_memsearch_ss): fix potential buffer overflow; fix #6158
...
- stop using `bigint*`
- stop integer pointer dereferences
- use `memcpy` to integer variables
- add reminder search for shorter patterns
2024-01-31 07:48:24 +09:00
Yukihiro "Matz" Matsumoto
219cfd63e1
string.c (mrb_memsearch_ss): update integer prefixes (LLU -> ULL)
2024-01-31 07:42:52 +09:00
Yukihiro "Matz" Matsumoto
6ba65ea0f0
string.c (mrb_memsearch_ss): update comment
2024-01-31 01:54:37 +09:00
Yukihiro "Matz" Matsumoto
44a5882bc2
string.c (mrb_memsearch_ss): remove useless alignment adjustment
...
Ref #6158
2024-01-31 01:27:10 +09:00
Yukihiro "Matz" Matsumoto
be5448fd16
string.c (mrb_memsearch): refactor m==1 (use memchr) case
2024-01-31 01:17:12 +09:00
Yukihiro "Matz" Matsumoto
d8e1aed646
string.c (search_nonascii): need not to check n>3 on 32bit platforms
2024-01-30 12:35:56 +09:00
dearblue
60dd6b5586
Allow to detect use-after-free after mrb_irep_free() for debugging
...
Write invalid value to `irep` if `MRB_DEBUG` is defined by `MRuby::Build#enable_debug`.
2024-01-29 21:32:04 +09:00
Yukihiro "Matz" Matsumoto
0e1125c3af
Merge pull request #6152 from dearblue/io-error
...
Retrieving the IO exception class with presym
2024-01-27 15:10:29 +09:00
Yukihiro "Matz" Matsumoto
fefebf7a77
Merge pull request #6151 from dearblue/eval-init
...
Refer to `mrb->module_class` directly in `mrb_mruby_eval_gem_init()`
2024-01-27 15:09:30 +09:00
Yukihiro "Matz" Matsumoto
e859b430cc
fixup! string.c (search_nonascii): add faster search using SSE2
2024-01-27 11:59:29 +09:00
Yukihiro "Matz" Matsumoto
dee1ded7b5
string.c (mrb_memsearch_ss): support bigendians
2024-01-27 06:23:16 +09:00
Yukihiro "Matz" Matsumoto
06d9a54760
string.c (mrb_memsearch): remove simple search and quick search
...
Since mrb_memsearch_ss() is fast enough for most of the cases, we try to
simplify the code.
2024-01-27 06:22:55 +09:00
Yukihiro "Matz" Matsumoto
2943ca2685
string.c (mrb_memsearch_ss): faster integer-wise substring search
...
The function is based on @WojciechMula's code from the repository
https://github.com/WojciechMula/sse4-strstr.git Since it's licensed
under 2 clause BSD, we updated LEGAL file too.
2024-01-27 06:16:33 +09:00
Yukihiro "Matz" Matsumoto
08cd281200
string.c (search_nonascii): skip alignment adjustment for some CPUs
...
Some CPUs (e.g. x86) allow unaligned access to the memory.
2024-01-26 08:22:33 +09:00
Yukihiro "Matz" Matsumoto
68ab95ea57
string.c (mrb_memsearch): take char* instead of void*
...
Avoid useless `void*`.
2024-01-25 22:32:31 +09:00
Yukihiro "Matz" Matsumoto
cf0cd6785c
string.c: rename MRB_QS_SHORT_STRING_LENGTH
...
The new name is MRB_SEARCH_SHORT_STRING_LENGTH since it's no longer used
in the mrb_memsearch_qs(). FYI, 'qs' stands for 'quick search'.
2024-01-23 23:28:45 +09:00
Yukihiro "Matz" Matsumoto
fb2ebcde7c
string.c (search_nonascii): add faster search using SSE2
2024-01-23 23:28:45 +09:00
Yukihiro "Matz" Matsumoto
4108b85c62
string.c (search_nonascii): faster search using integer match
...
If you define `SIMPLE_SEARCH_NONASCII`, you can use old, naive
implementation of search_nonascii(). You may want to use the old one for
code size constraint for example.
2024-01-23 23:28:45 +09:00
Yukihiro "Matz" Matsumoto
f41593f55a
Merge pull request #6154 from dearblue/int_to_str
2024-01-23 21:59:14 +09:00
Yukihiro "Matz" Matsumoto
18bdcbe536
Merge pull request #6145 from hoshiumiarata/enum_chunk
...
Enumerable#chunk implementation
2024-01-23 08:58:19 +09:00
星湖新
ab21813100
Move Enumerable#chunk to mruby-enumerator
2024-01-22 18:31:28 +09:00
星湖新
d001974439
Revert "Enumerable#chunk implementation"
...
This reverts commit ebf86a24b0 .
2024-01-22 18:26:01 +09:00
Yukihiro "Matz" Matsumoto
5431575d11
Merge pull request #6148 from buty4649/add-enumerable-grep_v
...
Add Enumerable#grep_v to mruby-enum-ext
2024-01-21 18:51:11 +09:00
dearblue
bf2db1ed2b
Check mrb_bigint_p() before mrb_integer()
2024-01-21 10:59:06 +09:00
Yukihiro "Matz" Matsumoto
028c53d667
Merge pull request #6149 from dearblue/rational.new
...
Remove unnecessary `Rational._new` method
2024-01-20 23:28:38 +09:00
Yukihiro "Matz" Matsumoto
888dd230dd
Merge pull request #6147 from dearblue/memsearch
...
Fixed buffer overflow in `mrb_memsearch()`
2024-01-20 23:25:34 +09:00
Yukihiro "Matz" Matsumoto
12483c8393
Merge pull request #6146 from mruby/dependabot/github_actions/actions/cache-4
...
build(deps): bump actions/cache from 3 to 4
2024-01-20 23:24:40 +09:00
dearblue
464ac4581e
Make MRuby::Gems::List#{each,<<} method return self
...
Returning internal objects is undesirable.
2024-01-20 22:49:31 +09:00
dearblue
5caf8e14cf
Retrieving the IO exception class with presym
2024-01-20 22:33:43 +09:00
dearblue
82312467d0
Refer to mrb->module_class directly in mrb_mruby_eval_gem_init()
2024-01-20 22:20:20 +09:00
dearblue
3111990089
Introduce mrb_obj_itself()
...
Some method definitions were changed to use this function.
2024-01-20 22:07:29 +09:00
dearblue
35375257f6
Remove unnecessary Rational._new method
2024-01-20 21:52:49 +09:00