Yukihiro "Matz" Matsumoto
6ae6b63aaf
mruby-struct: add recursive inspect check instead of _inspect hack
2023-06-22 12:53:51 +09:00
Yukihiro "Matz" Matsumoto
849963b81e
variable.c (mrb_obj_iv_inspect): support recursion detection
2023-06-21 23:36:59 +09:00
Yukihiro "Matz" Matsumoto
0713f2a840
mruby-set/set.rb (inspect): add recursive inspect check to Set#inspect
2023-06-20 11:25:49 +09:00
Yukihiro "Matz" Matsumoto
113565a1c5
hash.c (mrb_hash_to_s): add recursive inspect check to Hash#inspect
2023-06-20 11:18:38 +09:00
Yukihiro "Matz" Matsumoto
5cb0c7463b
array.c (mrb_ary_to_s): add recursive check to Array#inspect
2023-06-20 07:06:33 +09:00
Yukihiro "Matz" Matsumoto
e2bbf75d58
kernel.c: prepare for new recursive inspect check
...
Like previous recursive `<=>` check, scan call stack to detect recursive
`inspect` calls. We no longer need incomplete `_inspect` hack to pass
around a hash table to record objects currently inspecting.
2023-06-20 07:04:28 +09:00
Yukihiro "Matz" Matsumoto
75c8ffddf5
object.c (mrb_equal) move mrb_equal() back to object.c
2023-06-20 06:45:05 +09:00
Yukihiro "Matz" Matsumoto
89a1719a13
compar.rb: use equal?() instead of ==
...
To avoid unnecessary infinite recursion.
2023-06-19 15:33:13 +09:00
Yukihiro "Matz" Matsumoto
7f85ae2c48
Merge pull request #6022 from chasonr/msdos-build
...
Build configuration for MS-DOS and DJGPP
2023-06-18 18:13:24 +09:00
Ray Chason
23e9befbc0
Changes to cross-compile with DJGPP
2023-06-17 17:20:33 -04:00
Ray Chason
853b25972e
Build configuration for MS-DOS
2023-06-17 17:20:20 -04:00
Yukihiro "Matz" Matsumoto
a638a71c72
test/hash.rb: remove some inspect/to_s tests
...
CRuby does prohibits Hash modification during iteration, so remove those
self modifying inspect/to_s.
2023-06-17 17:56:41 +09:00
Yukihiro "Matz" Matsumoto
20552fe176
hash.c (mrb_hash_foreach): wrap function call with h_check_modified
...
If the iterating hash is modified in the function, h_each loop may
crash accessing modified (and probably deallocated) internal data.
2023-06-17 10:55:55 +09:00
Yukihiro "Matz" Matsumoto
e502fd88b9
kernel.c (mrb_cmp_m): check recursive <=> calls
...
If previous `<=>` method invocation with same arguments is detected in
the stack trace, this `<=>` call must be recursive and can cause stack
overflow.
2023-06-17 09:18:55 +09:00
Yukihiro "Matz" Matsumoto
7c9cb0901c
kernel.c (mrb_equal): simplify the code
2023-06-16 13:45:58 +09:00
Yukihiro "Matz" Matsumoto
5e4cecf766
internal.h: add mrb_obj_equal_m to internal.h
2023-06-15 23:36:27 +09:00
Yukihiro "Matz" Matsumoto
a04d18bb6d
kernel.c (mrb_eqq_m): rename function equal -> eqq
...
This function implements `Kernel#===` and it's usually abbreviated to
`eqq` not `equal`.
2023-06-15 23:32:41 +09:00
Yukihiro "Matz" Matsumoto
359c630d73
kernel.c (mrb_equal): move mrb_equal() from object.c
2023-06-15 23:31:45 +09:00
Yukihiro "Matz" Matsumoto
2be7cba8f5
kernel.c (obj_respond_to): refactoring
...
- skip basic_obj_respond_to(); call mrb_respond_to() directly
- narrower scope for `mrb_sym rtm_id`
- use mrb_func_basic_p() to detect override
- use mrb_funcall_id() to avoid local mrb_value array
2023-06-14 11:41:21 +09:00
Yukihiro "Matz" Matsumoto
347586e400
kernel.c: define respond_to_missing? method
2023-06-14 11:31:55 +09:00
Yukihiro "Matz" Matsumoto
e96d90dab2
Merge pull request #6017 from jbampton/standardize-pre-commit-config
...
Standardize the `pre-commit` config
2023-06-13 15:44:51 +09:00
Yukihiro "Matz" Matsumoto
7125481952
Merge pull request #6021 from jbampton/news-remove-duplicate-cve
...
NEWS: remove duplicate CVE from list
2023-06-13 14:09:59 +09:00
John Bampton
26659ef76c
NEWS: remove duplicate CVE from list
2023-06-13 15:02:57 +10:00
Yukihiro "Matz" Matsumoto
0d863ae85f
Merge pull request #6018 from jbampton/configure-dependabot-for-bundler
...
Configure Dependabot updates for Bundler/Ruby
2023-06-13 13:50:40 +09:00
Yukihiro "Matz" Matsumoto
c99403d635
Merge pull request #6020 from jbampton/fix-markdown-link
...
Enable markdownlint rule MD052
2023-06-13 13:49:49 +09:00
Yukihiro "Matz" Matsumoto
a332ea1f67
Merge pull request #6019 from jbampton/docs-remove-duplicate-cve
...
docs: remove duplicate CVE from list
2023-06-13 13:47:55 +09:00
John Bampton
50e0aad288
Enable markdownlint rule MD052
...
https://github.com/DavidAnson/markdownlint/blob/main/doc/md052.md
2023-06-13 14:34:52 +10:00
John Bampton
343a633fb0
doc: fix Markdown reference links
2023-06-13 14:31:29 +10:00
John Bampton
36f2d1733b
docs: remove duplicate CVE from list
2023-06-13 13:27:23 +10:00
John Bampton
760ce71af0
Configure Dependabot updates for Bundler/Ruby
...
https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/about-dependabot-version-updates#supported-repositories-and-ecosystems
In future this will keep the Gemfile.lock up to date
2023-06-13 12:44:00 +10:00
John Bampton
f14f2ae174
Standardize the pre-commit config
2023-06-13 08:54:17 +10:00
Yukihiro "Matz" Matsumoto
17720c9b7b
variable.c (const_get): avoid mrb_funcall if possible
...
Directly call mrb_const_missing() if const_missing is not overridden.
2023-06-12 23:47:35 +09:00
Yukihiro "Matz" Matsumoto
89f7bb1056
use more lightweight mrb_funcall_argv instead of mrb_funcall_id
2023-06-12 14:22:04 +09:00
Yukihiro "Matz" Matsumoto
39a29a7de1
mruby-bin-debugger/mrbgem.rake: fix defines configuration
...
`spec.build.defines` should be update inline. Otherwise, configuration
may differ from file to file.
2023-06-12 13:07:57 +09:00
Yukihiro "Matz" Matsumoto
a867fb0703
class.c: remove methID from the example and codespell dict
2023-06-09 17:56:21 +09:00
Yukihiro "Matz" Matsumoto
b6181ae58a
mruby/gc.h: reorder mrb_gc members to reduce alignment gaps
2023-06-09 17:19:09 +09:00
Yukihiro "Matz" Matsumoto
727a2ec793
gc.c (obj_free): use simpler is_dead()
...
`mrb_object_dead_p()` is heavier if the pointer is (or used to be) an
object in the heaps.
2023-06-07 17:03:32 +09:00
Yukihiro "Matz" Matsumoto
336b7efb41
gc.c (mrb_incremental_gc): clarify the if-condition
2023-06-06 11:29:48 +09:00
Yukihiro "Matz" Matsumoto
8b8e186688
gc.h: rename majorgc_old_threashold to oldgen_threashold
...
This field means that if you have more old generation objects than
this value, major GC mode will be turned on.
2023-06-06 11:26:35 +09:00
Yukihiro "Matz" Matsumoto
b47c8b738a
gc.c (clear_all_old): fix a generational GC bug
...
This issue was caused by 375d22b that introduced a serious mark
leakage in the generational GC mode.
2023-06-06 07:29:41 +09:00
Yukihiro "Matz" Matsumoto
0bb08718b8
gc.c (incremental_marking_phase): clear gcnext for debugging
2023-06-05 23:31:36 +09:00
Yukihiro "Matz" Matsumoto
6958368daa
gc.c (gc_mark_children): declare a loop variable in the for-statement
2023-06-05 23:30:33 +09:00
Yukihiro "Matz" Matsumoto
623cda5521
gc.c: make color macros literals for debugging clarity
2023-06-05 16:00:04 +09:00
Yukihiro "Matz" Matsumoto
f07281a026
Revert "object.h: make GC color uint8_t that fits in 3 bits"
...
The change made the size of mruby data types bigger on Win.
This reverts commit afcf7fc86d .
2023-06-03 16:55:58 +09:00
Yukihiro "Matz" Matsumoto
93648fc954
gc.c (mrb_env_unshare): fix a write barrier bug
2023-06-02 11:00:13 +09:00
Yukihiro "Matz" Matsumoto
9369679e36
vm.c: reduce local variables
2023-06-01 09:14:39 +09:00
Yukihiro "Matz" Matsumoto
5b61407414
class.c (prepare_singleton_class): defer method table allocation
2023-06-01 09:13:44 +09:00
Yukihiro "Matz" Matsumoto
0d8545e01b
error.c (frozen_error): change specifier from %t to %T
...
- `%t` prints type (class) of the argument
- `%T` prints real class of the argument, skipping TT_ICLASS, etc.
2023-05-31 08:35:54 +09:00
Yukihiro "Matz" Matsumoto
e6c89ef1f9
mruby.h: make mrb_check_frozen to a normal function from inline one
2023-05-31 08:33:58 +09:00
Yukihiro "Matz" Matsumoto
ccdf75c1c2
error.c: a new function mrb_check_frozen_value()
2023-05-31 08:31:13 +09:00