mimaki
28a1f7d143
Update version to 3.3.0RC2.
2024-01-04 14:56:56 +09:00
dearblue
69682e3d41
Fixed when combined mrb_fiber_resume() and Fiber#transfer
...
For example, the following code was crashing.
```c
#include <mruby.h>
#include <mruby/compile.h>
#include <mruby/proc.h>
int
main(int argc, char *argv[])
{
mrb_state *mrb = mrb_open();
mrb_value fiber = mrb_load_string(mrb, "Fiber.new { Fiber.new { 12345.6789 }.transfer }");
mrb_value res = mrb_fiber_resume(mrb, fiber, 0, NULL);
mrb_p(mrb, res);
mrb_close(mrb);
return 0;
}
```
2024-01-04 14:12:35 +09:00
John Bampton
f8511ecb22
Fix pre-commit failure from prettier
2024-01-01 18:32:48 +09:00
Yukihiro "Matz" Matsumoto
d4cd589733
NEWS: add mruby3.3 changes description
2024-01-01 10:11:32 +09:00
mimaki
82e289a64d
Update version to 3.3.0RC.
2023-12-29 16:02:13 +09:00
mimaki
c1ed125689
Merge remote-tracking branch 'origin/master' into stable
2023-12-29 14:26:19 +09:00
Yukihiro "Matz" Matsumoto
6d8323f3c7
mruby-pack (pack_unpack): unpack1 did not return single data; fix #6134
...
For following unpack directives:
- PACK_DIR_HEX (h)
- PACK_DIR_BSTR (b)
- PACK_DIR_STR (a,A,Z)
- PACK_DIR_BASE64 (m)
- PACK_DIR_QENC (M)
2023-12-29 13:09:14 +09:00
mimaki
c11679ad79
Merge remote-tracking branch 'origin/master' into stable
2023-12-29 10:51:32 +09:00
Yukihiro "Matz" Matsumoto
95aa92d5c4
Update AUTHORS (date and commit hash)
2023-12-28 23:36:40 +09:00
Yukihiro "Matz" Matsumoto
c1511d5f5d
AUTHORS: update entries [ci skip]
2023-12-28 19:51:31 +09:00
mimaki
e9047562a1
Merge branch 'master' into stable
2023-12-28 13:39:55 +09:00
Yukihiro "Matz" Matsumoto
67cb987510
doc/mruby3.{1,2}.md: update CVE links (nvd.nist.gov is down)
2023-12-27 22:24:12 +09:00
Yukihiro "Matz" Matsumoto
6ea3166005
doc/guides/memory.md: small style changes (markdownlink-cli)
2023-12-27 22:24:12 +09:00
Yukihiro "Matz" Matsumoto
ae43ce7593
mruby-time: refactor _POSIX_TIMERS handling issue; ref #6124
2023-12-27 22:24:12 +09:00
Yukihiro "Matz" Matsumoto
a8b82bfae5
Merge pull request #6128 from dearblue/fiber-end
...
Integrates the sequence when a fiber is terminated by `OP_RETURN`
2023-12-27 22:24:01 +09:00
Yukihiro "Matz" Matsumoto
e51c20888b
Merge pull request #6127 from dearblue/catch_handler_find
...
Changed parameters for `catch_handler_find()`
2023-12-27 22:22:12 +09:00
Yukihiro "Matz" Matsumoto
1ac4148020
Merge pull request #6126 from dearblue/block-return
...
Fixed return value of `OP_RETURN_BLK` called directly under C function
2023-12-27 22:19:36 +09:00
Yukihiro "Matz" Matsumoto
074374e28d
Merge pull request #6125 from dearblue/cross-c
...
Allow `OP_RETURN_BLK` to cross C boundaries
2023-12-27 22:18:06 +09:00
Yukihiro "Matz" Matsumoto
dc633ecae8
Merge pull request #6123 from dearblue/allocate-undef.2
...
Inherit `MRB_FL_UNDEF_ALLOCATE` in subclasses
2023-12-27 22:16:51 +09:00
Yukihiro "Matz" Matsumoto
7d83e9cd27
Merge pull request #6130 from sizious/dreamcast-shelf-build-config-overhaul
...
`dreamcast_shelf build config`: complete overhaul
2023-12-27 21:54:26 +09:00
SiZiOUS
f81b7a3a1f
dreamcast_shelf build config: complete overhaul
...
This configuration is used to support the Sega Dreamcast system.
mruby is now officially supported as a KallistiOS Port in kos-ports.
See: https://dreamcast.wiki/Using_Ruby_for_Sega_Dreamcast_development
2023-12-25 21:40:37 +00:00
Yukihiro "Matz" Matsumoto
ebf66a2b80
Add prettier pre-commit hook; close #5490
2023-12-25 08:02:58 +09:00
Yukihiro "Matz" Matsumoto
9c66d4a453
Merge pull request #6124 from sizious/mruby-time-update
...
`mruby-time`: protect against incorrectly defined `_POSIX_TIMERS`
2023-12-24 17:33:23 +09:00
dearblue
dba1dcdd25
Integrates the sequence when a fiber is terminated by OP_RETURN
...
In the `ensure` block while executing `fiber.transfer`, keep `fiber->cxt->prev` to be `NULL`.
2023-12-24 15:45:15 +09:00
dearblue
dc09000f01
Fixed return value of OP_RETURN_BLK called directly under C function
...
```ruby
def cross; Class.new { return 1 }; end; p cross'
# => #<Class:0x8245cf170> # without this patch
# => 1 # with this patch
```
2023-12-24 13:56:25 +09:00
dearblue
d41a2612f4
Allow OP_RETURN_BLK to cross C boundaries
...
The restriction was introduced in commit b563bcb7ff to resolve https://github.com/mruby/mruby/issues/3462 .
Subsequently, the `RBreak` object, introduced by mruby 1.3.0, allowed crossing the C boundary.
```ruby
def cross; Class.new { proc { return }.call }; end; cross
# => unexpected return (LocalJumpError) # without this patch
# => nothing raised # with this patch
```
2023-12-24 13:56:25 +09:00
SiZiOUS
c0ffc13801
mruby-time: protect against incorrectly defined _POSIX_TIMERS
...
This update avoids the following error: operator '&&' has no right operand (related to _POSIX_TIMERS)
See: https://stackoverflow.com/questions/48538243/macro-if-statement-returns-error-operator-has-no-right-operand
2023-12-23 19:16:23 +00:00
dearblue
6a9671eac7
Changed parameters for catch_handler_find()
...
- Removed `mrb` and `ci` parameters.
- Added `irep` parameter.
The caller must guarantee that `irep->clen > 0`.
2023-12-23 23:02:48 +09:00
dearblue
2a1ea7d605
Inherit MRB_FL_UNDEF_ALLOCATE in subclasses
...
If `Class#allocate` is prohibited, subclasses should also be implicitly prohibited.
```ruby
p Class.new(Struct).allocate.class
# => #<Class:0x82362ac00> by #6122
# => allocator undefined for #<Class:0x000000083a983220> (TypeError) by Ruby 3.2
```
Added `MRB_DEFINE_ALLOCATOR()` to allow subclasses to use `Class#allocate`.
Supplement to #6122 .
2023-12-23 21:01:42 +09:00
Yukihiro "Matz" Matsumoto
63580581f7
Merge pull request #6122 from dearblue/allocate-undef.1
...
Prohibit `Class#allocate` in a different way
2023-12-23 15:15:11 +09:00
dearblue
8ecfacefca
Prohibit Class#allocate in a different way
...
The method introduced by #5979 causes a fault by swapping classes.
```console
% bin/mruby -e 'Method = Proc; p Object.method(:inspect)'
zsh: segmentation fault (core dumped) bin/mruby -e 'Method = Proc; p Object.method(:inspect)'
```
After applying this patch, a `TypeError` exception will be raised.
```console
% bin/mruby -e 'Method = Proc; p Object.method(:inspect)'
trace (most recent call last):
[1] -e:1
-e:1:in method: allocation failure of Proc (TypeError)
```
However, if the `mrb_vtype` is the same object, the same care must still be taken as before.
```console
% bin/mruby -e 'Method = Binding; p method(:puts).eval("12345")'
trace (most recent call last):
[1] -e:1
-e:1:in eval: wrong argument type nil (expected Proc) (TypeError)
```
2023-12-22 21:59:34 +09:00
Yukihiro "Matz" Matsumoto
fa75865a33
Merge pull request #6121 from dearblue/separate-breaks
...
Separate unwinding process for `break` / `return`
2023-12-22 16:12:12 +09:00
Yukihiro "Matz" Matsumoto
97b522d778
src/fmt_fp.c: change condition order for memory safety
2023-12-22 15:35:21 +09:00
Yukihiro "Matz" Matsumoto
cfee5c2753
doc/guides/memory.md: guide to memory management customization
2023-12-21 16:48:33 +09:00
Yukihiro "Matz" Matsumoto
28b526cf81
Update .pre-commit-config.yaml
2023-12-21 16:47:16 +09:00
Yukihiro "Matz" Matsumoto
34c5d96e86
allof.c: mrb_default_allocf() definition in the separate file
...
So that the user can define their own version of mrb_default_alloc
function to override memory allocation of mruby.
2023-12-21 15:28:04 +09:00
dearblue
859f1b3002
Separate unwinding process for break / return
2023-12-20 21:54:53 +09:00
Yukihiro "Matz" Matsumoto
899a09152b
mruby.h (mrb_alloc): better description for the function type
2023-12-20 19:39:09 +09:00
Yukihiro "Matz" Matsumoto
72ca266ed7
mruby-io: rename some functions with io_buf prefix
...
Now all functions with `io_buf` takes `mrb_io_buf` as an argument.
Renamed functions (old names):
- io_init_buf (io_buf_init)
- io_fill_buf (io_buf_fill)
- io_fill_buf_comp (io_buf_fill_comp) for UTF-8 encoding
2023-12-20 08:59:46 +09:00
Yukihiro "Matz" Matsumoto
84fb9f40f0
mruby-io: some functions take mrb_io_buf as an argument
...
- io_buf_reset
- io_buf_shift
- io_buf_cat
- io_buf_cat_all
2023-12-20 08:59:46 +09:00
Yukihiro "Matz" Matsumoto
054f5b5284
mruby-io (io_eof): avoid unnecessary read(2) call
2023-12-20 08:59:46 +09:00
Yukihiro "Matz" Matsumoto
2e8bede6ea
mruby-io (io_read): small refactoring; ref #6118
...
If `outbuf` is `nil` we allocate a buffer string, if `outbuf` is a
string, we resize it to zero length. In the function `io_read`, this
condition is done twice, so we refactor out to `io_reset_outbuf()`.
2023-12-20 08:59:46 +09:00
Yukihiro "Matz" Matsumoto
2e24c94873
Merge pull request #6120 from dearblue/file-EBADF
...
Set `EBADF` if `check_file_descriptor()` fails
2023-12-20 08:59:29 +09:00
Yukihiro "Matz" Matsumoto
82ed1c2600
Merge pull request #6118 from dearblue/io.read
...
Fixed `IO#read` with `buf`.
2023-12-19 08:00:42 +09:00
Yukihiro "Matz" Matsumoto
992bd49344
Merge pull request #6116 from dearblue/send-branch
...
Improve branching in the execution part of the `OP_SEND` block
2023-12-18 12:17:39 +09:00
Yukihiro "Matz" Matsumoto
e8a36235d8
Merge pull request #6115 from dearblue/loop-inclusion
...
Replace `for` and `CHECKPOINT` block comprehensions
2023-12-18 12:16:38 +09:00
dearblue
5e3e75ed7b
Set EBADF if check_file_descriptor() fails
2023-12-17 10:50:59 +09:00
Yukihiro "Matz" Matsumoto
b20418cf78
Merge pull request #6119 from jbampton/fix-spelling
...
docs: fix spelling
2023-12-17 07:14:17 +09:00
John Bampton
4c79fce665
docs: fix spelling
2023-12-17 00:58:24 +10:00
dearblue
7611dc8338
Fixed IO#read with buf.
...
I hit the following two problems.
- `io.read(0, buf)` always returned a new empty string object.
- `io.read(num, buf)` was appending data to the given `buf`.
This also meant that `buf` was never empty if EOF was reached.
2023-12-16 14:42:52 +09:00
Yukihiro "Matz" Matsumoto
d14a269f49
Merge pull request #6114 from dearblue/integrate-catch
...
Move `L_RAISE` and `L_BREAK` blocks to `OP_RAISEIF`
2023-12-16 13:08:33 +09:00
Yukihiro "Matz" Matsumoto
ecea3f2531
Merge pull request #6117 from mruby/dependabot/github_actions/actions/upload-artifact-4
...
build(deps): bump actions/upload-artifact from 3 to 4
2023-12-16 13:05:38 +09:00
Yukihiro "Matz" Matsumoto
6fad067ded
mruby-binding: raise in upper count check
...
We count `Proc` upper links then check for upper bounds (default:20),
but now we raise an exception as soon as the count exceeds the limit so
that we can avoid traverse unnecessary upper links.
2023-12-16 12:21:55 +09:00
dependabot[bot]
1b7f2fb175
build(deps): bump actions/upload-artifact from 3 to 4
...
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact ) from 3 to 4.
- [Release notes](https://github.com/actions/upload-artifact/releases )
- [Commits](https://github.com/actions/upload-artifact/compare/v3...v4 )
---
updated-dependencies:
- dependency-name: actions/upload-artifact
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com >
2023-12-15 14:22:12 +00:00
dearblue
990e18ad59
Improve branching in the execution part of the OP_SEND block
...
The `MRB_METHOD_CFUNC_P()` macro contains several branches, which will be replaced by simple branches.
2023-12-15 21:46:00 +09:00
dearblue
7144eab350
Replace for and CHECKPOINT block comprehensions
...
I think it will make the eyes less tired for a process flow.
2023-12-15 21:46:00 +09:00
dearblue
e9904ddb2a
Move L_RAISE and L_BREAK blocks to OP_RAISEIF
...
`OP_RAISEIF` should be easier to relate than `OP_RETURN`.
2023-12-15 21:46:00 +09:00
Yukihiro "Matz" Matsumoto
24eca2e50b
mruby-fiber (fiber_to_s): omit position info for terminated fibers
...
Since Fiber#to_s did not include location information before #6105 ,
when location information cannot be retrieved for terminated fibers,
instead of meaningless information such as "(unknown):0", we omit
positional information altogether for terminated fibers; ref #6111
2023-12-14 18:56:19 +09:00
Yukihiro "Matz" Matsumoto
e9237f444a
Merge pull request #6111 from dearblue/fiber-to_s.1
...
Consider proc to be GC'ed if fiber is terminated
2023-12-14 14:59:18 +09:00
Yukihiro "Matz" Matsumoto
5311d1aa1b
Merge pull request #6106 from dearblue/fiber-limits-ease
...
Ease fiber limitations
2023-12-13 16:10:42 +09:00
Yukihiro "Matz" Matsumoto
ae8dcb82ba
vm.c: CINFO_SKIP should not be called with prev_jmp == NULL
...
We have added assertion to ensure.
2023-12-12 16:49:11 +09:00
Yukihiro "Matz" Matsumoto
89d4e8c851
Merge pull request #6113 from dearblue/unreachable
...
Remove unreachable code in `OP_R_BREAK`
2023-12-12 16:48:55 +09:00
dearblue
38c7936c94
Remove unreachable code in OP_R_BREAK
...
Termination of fiber by `break` results in a `LocalJumpError`, so the indicated code will not be executed.
2023-12-11 21:25:08 +09:00
Yukihiro "Matz" Matsumoto
93d842e045
Merge pull request #6112 from dearblue/labeler
...
Update labeler.yml for version 5
2023-12-10 20:01:17 +09:00
dearblue
c0b5bc4ae8
Consider proc to be GC'ed if fiber is terminated
...
When fiber is terminated, the pointer indicated by `f->cxt->cibase->proc` is not protected from GC.
I should have done this patch way as of commit 9af6264d6b (#6105 ).
2023-12-09 22:28:47 +09:00
dearblue
88571052e8
Update labeler.yml for version 5
2023-12-09 17:28:13 +09:00
Yukihiro "Matz" Matsumoto
34346e75a4
Merge pull request #6103 from dearblue/RBreak-ci
...
RBreak remembers the CI location
2023-12-09 11:35:23 +09:00
Yukihiro "Matz" Matsumoto
645a464b2d
mruby-fiber (fiber_to_s): retrieve position from terminated fibers; #6105
...
Since `cxt->ci` points to the last active callinfo, `cxt->ci == cxt->cibase`
does not mean it does not have correct `proc` information, so we have
removed the `f->cxt->ci > f->cxt->cibase` check. Instead, just in case
`proc` does not have `irep` information, we try to confirm `proc` does not
point to `CFUNC` nor is not an alias.
2023-12-08 09:33:05 +09:00
Yukihiro "Matz" Matsumoto
fdea7924fe
mruby-fiber (fiber_to_s): do not rely on mrb_any_to_s(); ref #6105
2023-12-08 09:25:46 +09:00
Yukihiro "Matz" Matsumoto
b7949e81d7
mruby-fiber (fiber_to_s): use "(unknown):0" for unknown position
...
Ref #6105
2023-12-08 09:22:59 +09:00
Yukihiro "Matz" Matsumoto
cb54138b81
Merge pull request #6105 from dearblue/fiber.to_s
...
Implement `Fiber#to_s` method
2023-12-08 09:00:05 +09:00
dearblue
73c8330cbd
RBreak remembers the CI location
...
It is now possible to specify return destination directly.
This allows callinfo to distinguish between calls to the same proc object.
At the same time, the `Kernel#catch` method is adjusted.
By removing the previously required double lambda object, the REnv object is no longer created as well.
2023-12-07 21:33:14 +09:00
Yukihiro "Matz" Matsumoto
658d5a51ac
mruby-string-ext: add test for String#valid_encoding?
2023-12-07 11:34:10 +09:00
Yukihiro "Matz" Matsumoto
eabe2d96e2
mruby-string-ext: add String#valid_encoding? method
2023-12-07 10:58:20 +09:00
Yukihiro "Matz" Matsumoto
bef7eea468
mruby-method: small refactoring mostly regarding declarations
2023-12-06 22:20:38 +09:00
Yukihiro "Matz" Matsumoto
b01eb03d2a
Merge pull request #6110 from mruby/dependabot/github_actions/actions/labeler-5
...
build(deps): bump actions/labeler from 4 to 5
2023-12-06 15:58:59 +09:00
Yukihiro "Matz" Matsumoto
fab3dfc145
Merge pull request #6107 from mruby/dependabot/github_actions/super-linter/super-linter-5.7.2
...
build(deps): bump super-linter/super-linter from 5.7.0 to 5.7.2
2023-12-06 15:58:47 +09:00
Yukihiro "Matz" Matsumoto
5a258f0872
Merge pull request #6109 from dearblue/fix-6108
...
Needs `cipop()` before crossing the C boundary
2023-12-06 15:57:16 +09:00
Yukihiro "Matz" Matsumoto
abd26b7ca6
mruby-bin-mrbc/mrbc.c: replace mrbc_ prefix by mrb_ccontext
...
This is a most confusion file because it contained both `mrbc_` from
"mruby compiler" (e.g. mrbc_args) and `mrbc_` from "mruby compiler
context".
2023-12-06 15:54:33 +09:00
Yukihiro "Matz" Matsumoto
7be67d3acf
mruby-bin-mirb: replace mrbc_ prefix by mrb_ccontext
2023-12-06 15:51:20 +09:00
Yukihiro "Matz" Matsumoto
72689b0b9c
mruby-eval: replace mrbc_ prefix by mrb_ccontext
2023-12-06 15:49:21 +09:00
Yukihiro "Matz" Matsumoto
7e74dbeed3
mruby-bin-mruby: replace mrbc_ prefix by mrb_ccontext
2023-12-06 15:45:01 +09:00
Yukihiro "Matz" Matsumoto
c36b212fa9
mruby-bin-debugger: replace mrbc_ prefix by mrb_ccontext
2023-12-06 15:41:15 +09:00
Yukihiro "Matz" Matsumoto
a66c685c81
mruby-bin-debugger/mrdb.h: remove unnecessary struct declarations
2023-12-06 15:40:31 +09:00
Yukihiro "Matz" Matsumoto
6de4df3b31
parse.y: replace mrbc_ prefix by mrb_ccontext
2023-12-06 15:32:13 +09:00
Yukihiro "Matz" Matsumoto
9c2af6aaed
load.c: replace mrbc_ prefix by mrb_ccontext
2023-12-06 15:29:02 +09:00
Yukihiro "Matz" Matsumoto
073a4f19f8
proc.h: update document in the comment (regarding compiler context)
2023-12-06 15:22:09 +09:00
Yukihiro "Matz" Matsumoto
c5e3cbe4bf
compile.h: stop using mrbc_ prefix for compiler context
...
Since it is confusing that the term `mrbc` stands for both "mruby
compiler" and "mruby compiler context" in the source code. Instead,
we use `mrb_ccontext` (stands for compiler context) prefix hereafter.
We choose `mrb_ccontext` because we have already used `mrb_context` (for
VM execusion context).
2023-12-06 15:22:08 +09:00
dependabot[bot]
7ac0b60255
build(deps): bump actions/labeler from 4 to 5
...
Bumps [actions/labeler](https://github.com/actions/labeler ) from 4 to 5.
- [Release notes](https://github.com/actions/labeler/releases )
- [Commits](https://github.com/actions/labeler/compare/v4...v5 )
---
updated-dependencies:
- dependency-name: actions/labeler
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com >
2023-12-05 14:41:52 +00:00
dearblue
ca9e8d91e4
Needs cipop() before crossing the C boundary
...
fix #6108
2023-12-05 22:03:38 +09:00
dependabot[bot]
7b74d22310
build(deps): bump super-linter/super-linter from 5.7.0 to 5.7.2
...
Bumps [super-linter/super-linter](https://github.com/super-linter/super-linter ) from 5.7.0 to 5.7.2.
- [Release notes](https://github.com/super-linter/super-linter/releases )
- [Changelog](https://github.com/super-linter/super-linter/blob/main/docs/release-process.md )
- [Commits](https://github.com/super-linter/super-linter/compare/v5.7.0...v5.7.2 )
---
updated-dependencies:
- dependency-name: super-linter/super-linter
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com >
2023-12-04 14:03:16 +00:00
dearblue
4f1c1c16da
Check fiber backward when switching with Fiber#transfer
...
Previously, if the caller of `Fiber#resume` had a C function call, an inconsistency would occur.
2023-12-04 22:32:57 +09:00
dearblue
42308c42b5
Fix CI misalignment between Fiber#resume and Fiber.yield
...
When a fiber switched by `Fiber.yield` is resumed by `Fiber#resume` by C, it is necessary to pop CI with `fiber_switch()`.
Previously, CI misalignment caused inconsistencies, including crashes, on the next `Fiber#resume`.
2023-12-04 22:32:57 +09:00
dearblue
568309b25a
Propagating exceptions to the caller of Fiber#resume
...
Need to return control from `mrb_vm_exec()` to the caller if `Fiber#resume` was done from C.
2023-12-04 22:32:57 +09:00
dearblue
aaa0f124c3
Restore the value of ci->cci with fiber_switch()
...
If `mrb_fiber_resume()` was called from a C function as a method definition, the mruby VM was not processed afterwards.
Called Fiber.yield
mrb_vm_exec() <<-- returns from the function by CINFO_RESUMED
fiber_switch() <<-- this patch causes the value to return to its pre-call state
mrb_fiber_resume()
mrb_vm_exec() <<-- previously, returns from the function immediately as it was CINFO_RESUMED
...
main()
2023-12-04 22:32:57 +09:00
dearblue
ef8b0b7ed8
Allows calling Fiber#resume from C
...
This patch is effectively reverts to the following:
- commit dc65b1faf1 (#5782 )
- commit f4c4809750 (#5947 )
Ref. #6063
2023-12-04 22:32:51 +09:00
dearblue
ad4c35b022
Enhanced Fiber Testing
...
The main objective is to make sure that fiber can be handled from C.
Also, add a mechanism to detect that the mruby VM has stopped in the middle of the process.
If it stops halfway, the test will be terminated with `abort()`.
2023-12-04 21:48:23 +09:00
Yukihiro "Matz" Matsumoto
7f1ae1c344
mruby-method (method_to_s): avoid goto across declarations for C++
2023-12-03 22:39:27 +09:00
Yukihiro "Matz" Matsumoto
90ec09a716
mruby-proc-ext (mrb_proc_source_location): support aliases
2023-12-03 22:38:31 +09:00
Yukihiro "Matz" Matsumoto
87453fb70b
vm.c (CI_PROC_SET): consider alias proc
2023-12-03 22:38:31 +09:00
Yukihiro "Matz" Matsumoto
9eae7df26e
mruby-method (method_to_s): _proc may be nil; add check
2023-12-03 22:38:31 +09:00
Yukihiro "Matz" Matsumoto
e8da16cdf5
vm.c (exec_irep): need to support aliases
2023-12-03 22:38:30 +09:00
Yukihiro "Matz" Matsumoto
02f189cebc
mruby-method (method_to_s): add origin name in the string representation
2023-12-03 22:38:30 +09:00
Yukihiro "Matz" Matsumoto
f5bc82f267
mruby-method (method_to_s): avoid origin class like Object(Object)
2023-12-03 22:38:30 +09:00
Yukihiro "Matz" Matsumoto
b52870b4c6
mruby-method: add const modifier to struct RProc*
2023-12-03 22:38:29 +09:00
Yukihiro "Matz" Matsumoto
9da0c7e1a4
Update .pre-commit-config.yaml
2023-12-03 09:39:33 +09:00
dearblue
9af6264d6b
Implement Fiber#to_s method
...
If the filename and line number cannot be obtained, "(unknown):1" is used instead.
Also, the file name information of the terminated fiber cannot be retrieved and will be replaced as well.
This limitation is due to the fact that `cibase->proc` of the terminated fiber is collected by the GC.
```console
% bin/mruby -e 'p Fiber.new { p Fiber.current }.resume'
#<Fiber:0x82423bef0 -e:1 (resumed)>
#<Fiber:0x82423bef0 (unknown):1 (terminated)>
```
2023-12-01 21:30:16 +09:00
Yukihiro "Matz" Matsumoto
ccdd81eb69
Merge pull request #6101 from dearblue/unwinding
...
Reorganization of unwinding at `break` / `return`.
2023-11-22 08:11:15 +09:00
Yukihiro "Matz" Matsumoto
fdef59b3a1
AUTHORS: update entries [ci skip]
2023-11-21 09:37:58 +09:00
Yukihiro "Matz" Matsumoto
53a8472e5e
mruby-kernel-ext/test: skip some tests that related to alias callee.
...
The last commit changed the behavior of aliases, and we no longer keep
the alias name symbol but the original name. Since this is a small
incompatibility from CRuby and it requires some memory to fix this, we
keep this issue right now.
2023-11-21 09:37:17 +09:00
Yukihiro "Matz" Matsumoto
f2dc76e3b5
Change alias handling to avoid using mid in Env; ref 6098
...
Since `Env` objects are shared by Blocks/Procs in the same context,
making multiple aliases in one context screws up with alias names.
New implementation uses alias bodies (Procs) to refer new names.
As a side effect, `__callee__` stop working correctly for aliases.
To fix this `__callee__` problem, we need to keep alias method names in
`callinfo`, which consumes more memory. We are wondering that is worth
the compatibility.
2023-11-21 09:37:17 +09:00
Yukihiro "Matz" Matsumoto
f6cbf6ac1a
Merge pull request #6102 from mruby/dependabot/github_actions/super-linter/super-linter-5.7.0
...
build(deps): bump super-linter/super-linter from 5.6.1 to 5.7.0
2023-11-21 09:37:07 +09:00
Yukihiro "Matz" Matsumoto
9c1c9ba8e5
vm.c: rename local variable m to p
...
`m` usually stands for a method but this one was `struct RProc*`.
2023-11-19 23:21:05 +09:00
Yukihiro "Matz" Matsumoto
956379928c
mruby-io/io.c: fix possible short integer overflow
2023-11-19 07:47:23 +09:00
Yukihiro "Matz" Matsumoto
698da0982f
mruby-io/io.c: fix fsize_t and mrb_ssize mixture
2023-11-19 07:45:29 +09:00
dependabot[bot]
ee7ea34b10
build(deps): bump super-linter/super-linter from 5.6.1 to 5.7.0
...
Bumps [super-linter/super-linter](https://github.com/super-linter/super-linter ) from 5.6.1 to 5.7.0.
- [Release notes](https://github.com/super-linter/super-linter/releases )
- [Changelog](https://github.com/super-linter/super-linter/blob/main/docs/release-process.md )
- [Commits](https://github.com/super-linter/super-linter/compare/v5.6.1...v5.7.0 )
---
updated-dependencies:
- dependency-name: super-linter/super-linter
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com >
2023-11-16 14:28:54 +00:00
Yukihiro "Matz" Matsumoto
91b4da3a2b
class.c: keep alias flag in proc object; fix #6098
2023-11-16 17:18:28 +09:00
Yukihiro "Matz" Matsumoto
9959d4fc66
range.c: use presym for symbol initialization
2023-11-16 16:30:40 +09:00
Yukihiro "Matz" Matsumoto
a94005b740
range.c: use presym to initialize Range class
2023-11-16 16:27:57 +09:00
dearblue
2e881d3297
Reorganization of unwinding at break / return.
...
The unwinding process that has been done at each point in time is now done in a merged block after looking for the last ci to `break` / `return`.
2023-11-12 20:39:33 +09:00
Yukihiro "Matz" Matsumoto
431d9d8a12
mrbgems/full-core.gembox: use parentheses for method call expression
2023-11-12 19:01:08 +09:00
Yukihiro "Matz" Matsumoto
76d0ff9a45
error.c: use presym for error initialization
2023-11-11 23:49:32 +09:00
Yukihiro "Matz" Matsumoto
8e6f4a79a8
hash.c: use presym to initialize Hash class
2023-11-11 23:48:31 +09:00
Yukihiro "Matz" Matsumoto
df1d397da5
numeric.c: use presym to initialize numeric classes
2023-11-11 23:48:31 +09:00
Yukihiro "Matz" Matsumoto
5084716e6b
class.c: use presym to undefine Module methods
2023-11-11 23:48:23 +09:00
Yukihiro "Matz" Matsumoto
d5a69ac8c7
proc.c: use presym to initialize Proc class
2023-11-07 21:40:45 +09:00
Yukihiro "Matz" Matsumoto
e41bbaa67a
class.c: move Proc class allocation to proc.c
2023-11-07 21:40:45 +09:00
Yukihiro "Matz" Matsumoto
eb906bd4c1
array.c: use presyms to define the class
2023-11-07 21:40:44 +09:00
Yukihiro "Matz" Matsumoto
1dec82d82f
object.c: use presyms to define classes
2023-11-07 21:40:44 +09:00
Yukihiro "Matz" Matsumoto
4fd63cfb9d
kernel.c: use presym to define a module
2023-11-07 21:40:44 +09:00
Yukihiro "Matz" Matsumoto
82f6facaad
Merge pull request #6097 from dearblue/fiber-new
...
Add a new `mrb_fiber_new()` with MRB_API
2023-11-07 21:40:31 +09:00
dearblue
1bb77170ec
Add a new mrb_fiber_new() with MRB_API
2023-11-05 20:36:29 +09:00
Yukihiro "Matz" Matsumoto
9e50d67fe7
Merge pull request #6096 from mruby/dependabot/github_actions/super-linter/super-linter-5.6.1
...
build(deps): bump super-linter/super-linter from 5.6.0 to 5.6.1
2023-11-03 07:35:13 +09:00
dependabot[bot]
52ac930af3
build(deps): bump super-linter/super-linter from 5.6.0 to 5.6.1
...
Bumps [super-linter/super-linter](https://github.com/super-linter/super-linter ) from 5.6.0 to 5.6.1.
- [Release notes](https://github.com/super-linter/super-linter/releases )
- [Changelog](https://github.com/super-linter/super-linter/blob/main/docs/release-process.md )
- [Commits](https://github.com/super-linter/super-linter/compare/v5.6.0...v5.6.1 )
---
updated-dependencies:
- dependency-name: super-linter/super-linter
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com >
2023-11-02 14:07:54 +00:00
Yukihiro "Matz" Matsumoto
587d93d5a5
Merge pull request #6095 from mruby/dependabot/github_actions/super-linter/super-linter-5.6.0
...
build(deps): bump super-linter/super-linter from 5.4.3 to 5.6.0
2023-11-02 13:21:35 +09:00
Yukihiro "Matz" Matsumoto
bc012deef9
object.c (mrb_eql): avoid mrb_funcall_argv() when possible
2023-11-02 13:20:10 +09:00
Yukihiro "Matz" Matsumoto
7db4050040
enum.c: use presym
2023-11-02 13:15:45 +09:00
Yukihiro "Matz" Matsumoto
8c068c57c8
Merge pull request #6092 from dearblue/lockfile
...
Get from local only if there is no default branch name
2023-11-02 12:07:56 +09:00
Yukihiro "Matz" Matsumoto
1e3d47760f
Merge pull request #6090 from LanzaSchneider/patch-1
...
fix(class.c): typo in format specifiers
2023-11-02 08:20:39 +09:00
Yukihiro "Matz" Matsumoto
8708186692
Merge pull request #6091 from dearblue/binding.5
...
Fixed acquisition of wrong target class in `Kernel#binding`
2023-11-01 23:05:50 +09:00
Yukihiro "Matz" Matsumoto
c99b67db65
gc.c: use presym for GC initialization
2023-11-01 22:24:57 +09:00
Yukihiro "Matz" Matsumoto
c080d16150
string.c: use presym to define String class
2023-11-01 22:23:35 +09:00
Yukihiro "Matz" Matsumoto
571cb54f38
compar.c: remove unused file
2023-11-01 22:21:59 +09:00
dependabot[bot]
ccf37b00aa
build(deps): bump super-linter/super-linter from 5.4.3 to 5.6.0
...
Bumps [super-linter/super-linter](https://github.com/super-linter/super-linter ) from 5.4.3 to 5.6.0.
- [Release notes](https://github.com/super-linter/super-linter/releases )
- [Changelog](https://github.com/super-linter/super-linter/blob/main/docs/release-process.md )
- [Commits](https://github.com/super-linter/super-linter/compare/v5.4.3...v5.6.0 )
---
updated-dependencies:
- dependency-name: super-linter/super-linter
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com >
2023-10-31 14:26:22 +00:00
dearblue
8284234229
Get from local only if there is no default branch name
...
The branch name of the cloned repository should be determined by the build configuration file.
fixes #6087
2023-10-28 19:02:50 +09:00
dearblue
0b25c9d224
Fixed acquisition of wrong target class in Kernel#binding
...
fixed #6089
2023-10-28 18:24:41 +09:00
Lanza
4ae0bacc6e
fix(class.c): typo in format specifiers
2023-10-28 13:47:05 +08:00
Yukihiro "Matz" Matsumoto
552944b34e
Merge pull request #6088 from jbampton/format-markdown-table
...
Standardize Markdown table format
2023-10-27 07:46:14 +09:00
John Bampton
bbd5701617
Standardize Markdown table format
2023-10-26 16:15:57 +10:00
Yukihiro "Matz" Matsumoto
c1feb41828
Merge pull request #6056 from dearblue/build/host-shared
...
Brush up `build_config/host-shared.rb` file
2023-10-26 14:23:49 +09:00
Yukihiro "Matz" Matsumoto
ac73793a8f
range.c: use mrb_define_method_id() which directly use symbols
2023-10-25 22:01:54 +09:00
dearblue
41cce1561f
Brush up build_config/host-shared.rb file
...
Summary:
- VisualC++ does not supported.
- `cc.flags` must maintain array objects.
2023-10-25 21:58:28 +09:00
Yukihiro "Matz" Matsumoto
7a08c7042f
string.c: move __ENCODING__ from kernel.c
2023-10-25 15:05:10 +09:00
Yukihiro "Matz" Matsumoto
f85a3aff2b
Merge pull request #6086 from yujiyokoo/add-wii-build-config
...
Add build config for Nintendo Wii
2023-10-23 17:34:33 +09:00
Yukihiro "Matz" Matsumoto
279e100ad5
Merge pull request #6085 from dearblue/define_installer.1
...
Fixed `MRuby::Build#define_installer`
2023-10-23 15:36:14 +09:00
Yukihiro "Matz" Matsumoto
bba659f174
Merge pull request #6083 from mruby/dependabot/github_actions/super-linter/super-linter-5.4.3
...
build(deps): bump super-linter/super-linter from 5.4.0 to 5.4.3
2023-10-23 15:34:17 +09:00
Yukihiro "Matz" Matsumoto
461c97225e
LICENSE: remove the end date of copyright notice; close #6080
2023-10-23 15:31:34 +09:00
Yukihiro "Matz" Matsumoto
e7e47bb683
AUTHORS: update entries [ci skip]
2023-10-23 15:29:23 +09:00
Yukihiro "Matz" Matsumoto
0443f14fd0
array.c,hash.c,numeric.c,string.c: use mrb_define_method_id()
...
For primary class libraries.
2023-10-23 15:23:08 +09:00
Yukihiro "Matz" Matsumoto
8ad825dc3b
class.c,kernel.c,object.c: use mrb_define_method_id()
...
Instead of mrb_define_method(), so that symbol resolution can be done in
compile-time.
2023-10-23 15:18:26 +09:00
Yukihiro "Matz" Matsumoto
0b8daabf27
object.c: fix wrong ISO section numbers
2023-10-23 12:26:51 +09:00
Yukihiro "Matz" Matsumoto
fe6f9faba4
vm.c: reduce number of check_method_noarg() calls
2023-10-22 22:04:58 +09:00
Yuji Yokoo
2b9287dbc4
Add build_config.rb for Nintendo Wii
2023-10-22 00:07:22 +10:30
dearblue
9b0d516310
Fixed MRuby::Build#define_installer
...
Symbolic links were created with absolute paths, but to cope with path fluctuations between build and reference, they are now relative paths.
ref. #6084
2023-10-21 19:42:26 +09:00
dependabot[bot]
3c5aa936c7
build(deps): bump super-linter/super-linter from 5.4.0 to 5.4.3
...
Bumps [super-linter/super-linter](https://github.com/super-linter/super-linter ) from 5.4.0 to 5.4.3.
- [Release notes](https://github.com/super-linter/super-linter/releases )
- [Changelog](https://github.com/super-linter/super-linter/blob/main/docs/release-process.md )
- [Commits](https://github.com/super-linter/super-linter/compare/v5.4.0...v5.4.3 )
---
updated-dependencies:
- dependency-name: super-linter/super-linter
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com >
2023-10-18 14:50:06 +00:00
Yukihiro "Matz" Matsumoto
10d4a4278e
class.c: make keyword_max mrb_int; ref #4754
...
Which is compared to other mrb_int.
2023-10-17 13:27:19 +09:00
Yukihiro "Matz" Matsumoto
9553284480
Merge pull request #6081 from dearblue/open-x
...
Add "x" mode option for `IO.open`
2023-10-17 13:27:07 +09:00
dearblue
88bc8c9144
Add "x" mode option for IO.open
...
From CRuby 2.6 feature.
This is the "x" mode (`O_EXCL`; exclusive create) of `fopen(3)` introduced in C11.
ref. https://bugs.ruby-lang.org/issues/11258
2023-10-15 16:41:48 +09:00
dearblue
782fd7e014
Integrate error handling for IO.open
2023-10-15 16:32:01 +09:00
Yukihiro "Matz" Matsumoto
dec81fde4a
Merge pull request #6079 from jbampton/fix-case-of-mruby
...
include/mruby/version.h: change `MRuby` to `mruby`
2023-10-15 05:16:04 +07:00
Yukihiro "Matz" Matsumoto
244156af2a
Merge pull request #6078 from jbampton/fix-indent
...
Fix indentation in two Ruby files
2023-10-15 05:15:38 +07:00
John Bampton
db20a19711
include/mruby/version.h: change MRuby to mruby
2023-10-14 19:13:49 +10:00
John Bampton
a83d7d3510
Fix indentation in two Ruby files
2023-10-14 18:52:30 +10:00
Yukihiro "Matz" Matsumoto
4656ea5ccd
Merge pull request #6000 from jbampton/update-docker-files
...
docker: use less image layers and update compose version
2023-10-14 05:36:04 +07:00
Yukihiro "Matz" Matsumoto
56a46cdff5
Merge pull request #6075 from mruby/dependabot/github_actions/super-linter/super-linter-5.4.0
...
build(deps): bump super-linter/super-linter from 5.3.1 to 5.4.0
2023-10-14 05:34:49 +07:00
Yukihiro "Matz" Matsumoto
c22fbb2aa7
Merge pull request #6076 from dearblue/fiber-unwinding
...
Fixed unwinding block that could point to invalid PC
2023-10-13 20:33:03 +07:00
Yukihiro "Matz" Matsumoto
3e20c5c9b3
Merge pull request #6069 from dearblue/MRUBY_PACKAGE_DIR
...
Corrected wrong `MRUBY_PACKAGE_DIR`
2023-10-13 16:04:25 +07:00
Yukihiro "Matz" Matsumoto
4c696ed9e3
array.c: set array size limitation again
...
Unlike strings, arrays occupies more memory. It is still arguable
whether the current limit (131072) is appropriate.
2023-10-13 18:01:21 +09:00
Yukihiro "Matz" Matsumoto
1321e33f08
mruby-range-ext: implement __empty_range? in C
2023-10-13 16:59:21 +09:00
Yukihiro "Matz" Matsumoto
deae227dff
mruby-range-ext: update overlap? to handle empty ranges
...
The code is taken from ActiveSupport (Rails).
2023-10-12 13:40:28 +09:00
Yukihiro "Matz" Matsumoto
3277cc9ce1
numeric.c (int_to_s): avoid mrb_get_args()
2023-10-11 20:32:09 +09:00
Yukihiro "Matz" Matsumoto
717f91e5c6
array.c (mrb_ary_last): avoid mrb_get_args()
2023-10-11 20:31:23 +09:00
Yukihiro "Matz" Matsumoto
fae8e55396
pool.c (mrb_pool_realloc): add comments in reallocation code
2023-10-11 13:39:53 +09:00
Yukihiro "Matz" Matsumoto
64e08c6d99
pool.c: add cast to void*
2023-10-11 13:38:59 +09:00
Yukihiro "Matz" Matsumoto
5d53c2b951
pool.c: remove unused mrb_pool_can_realloc()
2023-10-10 22:31:34 +09:00
Yukihiro "Matz" Matsumoto
a538837fb1
pool.c (mrb_pool_realloc): do nothing if realloc() tries to shrink
2023-10-10 22:17:30 +09:00
dearblue
e7828bac4d
Fixed unwinding block that could point to invalid PC
...
Switching back from a fiber with an exception could point to an invalid PC.
The investigation was inspired by #6060 .
2023-10-10 21:29:38 +09:00
Yukihiro "Matz" Matsumoto
42a621b42e
pool.c: small refactoring regarding local variable declarations
2023-10-10 14:49:19 +09:00
dependabot[bot]
66ce1c03f4
build(deps): bump super-linter/super-linter from 5.3.1 to 5.4.0
...
Bumps [super-linter/super-linter](https://github.com/super-linter/super-linter ) from 5.3.1 to 5.4.0.
- [Release notes](https://github.com/super-linter/super-linter/releases )
- [Changelog](https://github.com/super-linter/super-linter/blob/main/docs/release-process.md )
- [Commits](https://github.com/super-linter/super-linter/compare/v5.3.1...v5.4.0 )
---
updated-dependencies:
- dependency-name: super-linter/super-linter
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com >
2023-10-09 14:09:08 +00:00
Yukihiro "Matz" Matsumoto
097681b4d4
mruby-pack: unpack "b/B" should limit result size
2023-10-09 22:39:44 +09:00
Yukihiro "Matz" Matsumoto
861f8bdfa9
mruby-enumerator: add Enumerator#size
...
If the original object responds to `size` method, `Enumerator#size` calls
that method, otherwise return `nil`. CRuby returns the exact size for
more cases (e.g. Enumerable::Lazy#size), but mruby has more limitations.
2023-10-09 22:39:43 +09:00
Yukihiro "Matz" Matsumoto
49f86f19b2
mruby-enumerator: put "__" prefix to internal enumerator_block_call()
2023-10-09 22:39:43 +09:00
Yukihiro "Matz" Matsumoto
735fa246bf
mruby-enumerator: remove internal attribute methods; ref #6068
...
Removed methods: obj, args, kwd, meth, fib.
2023-10-09 22:39:43 +09:00
Yukihiro "Matz" Matsumoto
298155d59e
Merge pull request #6071 from jbampton/pre-commit-autoupdate
2023-10-06 23:58:45 +09:00
John Bampton
903ffb1584
pre-commit autoupdate
...
https://pre-commit.com/#pre-commit-autoupdate
2023-10-04 01:17:23 +10:00
John Bampton
24ac7a547a
Fix spelling
2023-10-04 01:17:23 +10:00
Yukihiro "Matz" Matsumoto
83d12f8d52
vm.c: GCC does not provide __has_feature()
2023-10-03 01:05:26 +09:00
Yukihiro "Matz" Matsumoto
b9536ea35f
vm.c: use smaller MRB_CALL_LEVEL_MAX with address sanitizer; fix #6068
...
Since ASAN uses lower memory bound. The other ideas to address #6068
might follow, e.g. removing `args=` from Enumerator.
2023-10-02 21:15:54 +09:00
Yukihiro "Matz" Matsumoto
771b56c796
mruby-socket: hide internal method new_with_prelude
...
- rename new_with_prelude to _new_with_prelude
- take a block instead of proc
2023-09-28 14:36:42 +09:00
Yukihiro "Matz" Matsumoto
67f1f0997c
Merge pull request #6070 from komainu8/demotion-mrb_f_raise-from-mrb_api
...
Demotion mrb_f_raise() in kernel.c from MRB_API too
2023-09-28 14:22:19 +09:00
Yukihiro "Matz" Matsumoto
10aab4cc1b
proc.c: prohibit direct Proc allocation() like CRuby; ref #6065
2023-09-28 11:37:46 +09:00
Yukihiro "Matz" Matsumoto
d298da8e72
vm.c (eval_under): check if irep is NULL; fix #6065
2023-09-28 11:37:07 +09:00
Yukihiro "Matz" Matsumoto
0e98508c33
string.c (mrb_string_value_cstr): RSTR_PTR(s) may be NULL; fix #6067
2023-09-28 09:26:02 +09:00
Yukihiro "Matz" Matsumoto
4c7fab6126
string.c (check_null_byte): str may point NULL buffer; ref #6067
2023-09-28 09:24:30 +09:00
Horimoto Yasuhiro
d55cec41eb
Demotion mrb_f_raise() in kernel.c from MRB_API
...
The prototype declaration of mrb_f_raise() has arleady demoted from
MRB_API in a below commit.
https://github.com/mruby/mruby/commit/0898ce982eea706c9a7b814280cdda09e82abe17
However, the entity of mrb_f_raise() in kernel.c is set MRB_API yet.
Therefore, mruby occures build error with MSVC(in Visual Studio 2022) as below.
https://github.com/groonga/groonga/actions/runs/6310140553/job/17131485675#step:11:2067
The cause of the above error that we define both mrb_f_raise() with
MRB_API and mrb_f_raise() without MRB_API.
2023-09-28 09:17:54 +09:00
Yukihiro "Matz" Matsumoto
0ac917e228
Revert "mrbgems/mruby-struct/src/struct.c: use direct array access"
...
This reverts commit 159ff5b28d .
Fix #6066
2023-09-28 07:40:31 +09:00
Yukihiro "Matz" Matsumoto
a80f394d97
mruby-array-ext (ary_rotate_bang): mrb_ary_modify may alter buf address
2023-09-27 18:37:38 +09:00
Yukihiro "Matz" Matsumoto
629a6839fd
mruby-array-ext (ary_compact_bang): skip check that is always true
2023-09-27 18:32:44 +09:00
Yukihiro "Matz" Matsumoto
f65229d103
mruby-array-ext (ary_compact_bang): mrb_ary_modify may alter buf address
2023-09-27 18:30:43 +09:00
Yukihiro "Matz" Matsumoto
7d3679dfc8
mruby-string-ext: refactoring
...
- raise exception in utf8code
- str_codepoints() use mrb_utf8len_table directly
2023-09-27 18:11:19 +09:00
Yukihiro "Matz" Matsumoto
5705d884ce
mruby-string-ext (utf8code): change arguments to point at the end
2023-09-27 18:08:12 +09:00
dearblue
c805d4dbba
Corrected wrong MRUBY_PACKAGE_DIR
...
ref. #6064
2023-09-25 21:50:31 +09:00
Yukihiro "Matz" Matsumoto
2e3b482aa9
array.c, string.c: remove length limits on UNIX-ish OSes
...
- Linux
- MacOS
- FreeBSD
- OpenBSD
Send us a pull-request if you want to add your favorite OS here.
The size limitation will be done by malloc(3) on those OSes.
2023-09-23 19:57:44 +09:00
Yukihiro "Matz" Matsumoto
15bb6a9f9b
mruby-string-ext: fix a typo; ref #6016
2023-09-23 11:44:15 +09:00
Yukihiro "Matz" Matsumoto
8a538c40c0
mruby-string-ext: implement core part of codepoints in C; close #6061
2023-09-23 11:36:20 +09:00
Yukihiro "Matz" Matsumoto
2db80b81c9
Merge pull request #6062 from mruby/dependabot/github_actions/super-linter/super-linter-5.3.1
...
build(deps): bump super-linter/super-linter from 5.3.0 to 5.3.1
2023-09-23 00:04:07 +09:00
Yukihiro "Matz" Matsumoto
9ee7edc1ac
mruby-fiber/fiber.c (fiber_switch): check c->cibase->proc env is NULL
...
ref #6060
2023-09-22 19:36:33 +09:00
dependabot[bot]
ed30e2e568
build(deps): bump super-linter/super-linter from 5.3.0 to 5.3.1
...
Bumps [super-linter/super-linter](https://github.com/super-linter/super-linter ) from 5.3.0 to 5.3.1.
- [Release notes](https://github.com/super-linter/super-linter/releases )
- [Changelog](https://github.com/super-linter/super-linter/blob/main/docs/release-process.md )
- [Commits](https://github.com/super-linter/super-linter/compare/v5.3.0...v5.3.1 )
---
updated-dependencies:
- dependency-name: super-linter/super-linter
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com >
2023-09-21 14:29:25 +00:00
Yukihiro "Matz" Matsumoto
0730bda60e
mruby-range-ext: add tests for Range#overlap?
2023-09-21 15:28:56 +09:00
Yukihiro "Matz" Matsumoto
384d0e2d21
mruby-range-ext: implement Range#overlap? method
...
Which is implemented in CRuby recently.
2023-09-21 15:28:06 +09:00
Yukihiro "Matz" Matsumoto
393aaada64
mruby-pack/pack.c (read_tmpl): fix out-of-bound access with templates
2023-09-20 09:51:22 +09:00
Yukihiro "Matz" Matsumoto
b064d7e547
mruby-time/time.c (time_alloc_time): need to handle negative time_t
2023-09-19 14:22:49 +09:00
Yukihiro "Matz" Matsumoto
ec3baece4f
vm.c (catch_handler_find): check if irep is NULL; fix #6052
2023-09-19 14:22:49 +09:00
Yukihiro "Matz" Matsumoto
75e8a72649
vm.c (CI_PROC_SET): check whether p->body.irep is not NULL; ref #6052
2023-09-19 14:22:49 +09:00
Yukihiro "Matz" Matsumoto
8afb73f3e2
mruby-socket/socket.rb: should not call unix_path for non UNIX Addrinfo
...
ref #6051
2023-09-19 14:22:49 +09:00
Yukihiro "Matz" Matsumoto
52082ba399
mruby-socket/socket.c (mrb_addrinfo_unix_path): check sockaddr type
...
`sockaddr` should be a string; fix #6051
2023-09-19 14:22:49 +09:00
Yukihiro "Matz" Matsumoto
40f08e22f1
Merge pull request #6058 from mruby/dependabot/github_actions/super-linter/super-linter-5.3.0
...
build(deps): bump super-linter/super-linter from 5.2.2 to 5.3.0
2023-09-19 14:05:20 +09:00
dependabot[bot]
38113d2524
build(deps): bump super-linter/super-linter from 5.2.2 to 5.3.0
...
Bumps [super-linter/super-linter](https://github.com/super-linter/super-linter ) from 5.2.2 to 5.3.0.
- [Release notes](https://github.com/super-linter/super-linter/releases )
- [Changelog](https://github.com/super-linter/super-linter/blob/main/docs/release-process.md )
- [Commits](https://github.com/super-linter/super-linter/compare/v5.2.2...v5.3.0 )
---
updated-dependencies:
- dependency-name: super-linter/super-linter
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com >
2023-09-18 14:15:49 +00:00
Yukihiro "Matz" Matsumoto
39d805e1da
Merge pull request #6055 from dearblue/libmruby-name
...
Fix libmruby name for VisualC++
2023-09-18 15:47:41 +09:00
Yukihiro "Matz" Matsumoto
3ce5f2df8b
Merge pull request #6054 from dearblue/mruby-config-plus
...
Extends `bin/mruby-config`
2023-09-17 18:23:54 +09:00
dearblue
7112db9fba
Extends bin/mruby-config
...
Added output for C++ and Assembly, ObjectiveC.
2023-09-17 17:48:36 +09:00
dearblue
7ac536e3ca
Fix libmruby name for VisualC++
2023-09-17 17:42:25 +09:00
Yukihiro "Matz" Matsumoto
74949b3e7e
Merge pull request #6053 from dearblue/gitattributes
...
Add `.gitattributes` for newline code normalization
2023-09-17 16:36:28 +09:00
dearblue
078b5ccaff
Add .gitattributes for newline code normalization
...
References:
- [Git] リポジトリで改行コードを正規化する
https://zenn.dev/murnana/articles/eol-and-gitattributes
- 行終端を処理するようGitを設定する - GitHub Docs
https://docs.github.com/ja/get-started/getting-started-with-git/configuring-git-to-handle-line-endings
2023-09-17 13:52:48 +09:00
Yukihiro "Matz" Matsumoto
4810706ccc
vm.c: refactor redundant if conditions
2023-09-16 14:49:58 +09:00
Yukihiro "Matz" Matsumoto
f041d3a5d5
Merge pull request #6047 from mruby/dependabot/github_actions/super-linter/super-linter-5.2.2
...
build(deps): bump super-linter/super-linter from 5.2.1 to 5.2.2
2023-09-15 13:35:03 +09:00
Yukihiro "Matz" Matsumoto
e8254eda42
gc.c: update comment for flexible array members (C++ incompatible) [ci skip]
2023-09-15 13:33:52 +09:00
Yukihiro "Matz" Matsumoto
4fe8b074bb
gc.c: remove prev link from mrb_heap_page
2023-09-15 13:33:52 +09:00
Yukihiro "Matz" Matsumoto
44b5153360
gc.c: revert af68de52dddd80afe1620c45680eb055767a412f
...
The change increased memory consumption significantly
2023-09-15 13:33:52 +09:00
Yukihiro "Matz" Matsumoto
22e74a7ee5
gc.c: experiment before removing page->prev link
2023-09-15 13:33:52 +09:00
Yukihiro "Matz" Matsumoto
9b90fd4f60
gc.c (incremental_sweep_phase): rebuild free pages link only if needed
2023-09-15 13:33:52 +09:00
Yukihiro "Matz" Matsumoto
9f840e111a
gc.c: inline unlink_heap_page which was called only once
2023-09-15 13:33:52 +09:00
Yukihiro "Matz" Matsumoto
0f69e93664
gc.c: inline link_heap_page which was called once
2023-09-15 13:33:51 +09:00
Yukihiro "Matz" Matsumoto
117fcfc8e9
gc.c: stop using bidirectional link for free_heaps
...
Reduce size of the heap pages again; ref #6041
2023-09-15 13:33:51 +09:00
Yukihiro "Matz" Matsumoto
e1c96b709a
Merge pull request #6045 from dearblue/presym-escape.2
...
Fixes escape sequence bug and enhancements in Presym scanning
2023-09-15 13:11:26 +09:00
dependabot[bot]
d8ad654460
build(deps): bump super-linter/super-linter from 5.2.1 to 5.2.2
...
Bumps [super-linter/super-linter](https://github.com/super-linter/super-linter ) from 5.2.1 to 5.2.2.
- [Release notes](https://github.com/super-linter/super-linter/releases )
- [Changelog](https://github.com/super-linter/super-linter/blob/main/docs/release-process.md )
- [Commits](https://github.com/super-linter/super-linter/compare/v5.2.1...v5.2.2 )
---
updated-dependencies:
- dependency-name: super-linter/super-linter
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com >
2023-09-13 14:08:56 +00:00
Yukihiro "Matz" Matsumoto
d708931b10
gc.c: revert 38b9a25e83
...
Fix #6041
2023-09-09 14:31:13 +09:00
dearblue
25f360803c
Fixes escape sequence bug and enhancements in Presym scanning
...
In #6011 , a hexadecimal escape sequence followed by a hexadecimal character would cause a compile error.
Also, avoid using "Numbered Parameter" which older Ruby does not have (e.g. AppVeyor).
ref. #6044
2023-09-08 22:57:24 +09:00
Yukihiro "Matz" Matsumoto
5eddccf89a
gc.c: remove unnecessary symbol local variables
2023-09-08 14:15:54 +09:00
Yukihiro "Matz" Matsumoto
d7b2e3ab14
mruby-compiler/parse.y: add print name for identifier tokens
2023-09-05 23:29:24 +09:00
Yukihiro "Matz" Matsumoto
e8841fbf58
gc.h: move mrb_heap_page definition to gc.c
2023-09-05 23:29:24 +09:00
Yukihiro "Matz" Matsumoto
acf5b74daa
vm.c (ary_new_from_regs): avoid mrb_ary_push()
...
Use mrb_ary_new_from_values(), which is faster instead.
2023-09-05 23:29:23 +09:00
Yukihiro "Matz" Matsumoto
9914243d68
vm.c: use direct array access if possible
2023-09-05 23:29:23 +09:00
Yukihiro "Matz" Matsumoto
0eef05cc00
array.c (mrb_ary_to_s): use direct array access
2023-09-05 23:29:23 +09:00
Yukihiro "Matz" Matsumoto
159ff5b28d
mrbgems/mruby-struct/src/struct.c: use direct array access
...
Unless we need boundary check, we don't need to use mrb_ary_ref().
2023-09-05 23:29:23 +09:00
Yukihiro "Matz" Matsumoto
1578f4bb99
mruby-data/data.c: use direct array access
...
Unless we need boundary check, we don't need to use mrb_ary_ref()
2023-09-05 23:29:23 +09:00
Yukihiro "Matz" Matsumoto
4cf810e4ea
Merge pull request #6042 from mruby/dependabot/github_actions/actions/checkout-4
...
build(deps): bump actions/checkout from 3 to 4
2023-09-05 23:28:55 +09:00
dependabot[bot]
f893c18088
build(deps): bump actions/checkout from 3 to 4
...
Bumps [actions/checkout](https://github.com/actions/checkout ) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases )
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md )
- [Commits](https://github.com/actions/checkout/compare/v3...v4 )
---
updated-dependencies:
- dependency-name: actions/checkout
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com >
2023-09-04 14:59:02 +00:00
Yukihiro "Matz" Matsumoto
792459e63d
Merge pull request #6040 from dearblue/puts-eol
...
Convert to string before output in `puts`
2023-08-30 22:30:58 +09:00
Yukihiro "Matz" Matsumoto
a20fbe54b9
mrbgems/mruby-test/mrbgem.rake: stop mrb isolation for each test file
...
It reduces the number of `mrb_state` initialization in `mrbtest`. But at
the same time, each test in a gem shares states (classes, methods, etc.)
2023-08-30 18:32:48 +09:00
Yukihiro "Matz" Matsumoto
a67f32561f
test/t/codegen.rb: test 127 arguments with break not next
...
In addition, avoid using undefined constant `A` because it terminates
actual execution by `NameError`.
2023-08-30 18:28:59 +09:00
dearblue
301bcc636e
Convert to string before output in puts
...
For example, evaluating `puts nil` raised `NoMethodError` before.
2023-08-29 21:59:09 +09:00
Yukihiro "Matz" Matsumoto
a17fdb7481
AUTHORS: update entries [ci skip]
2023-08-28 10:59:29 +09:00
Yukihiro "Matz" Matsumoto
b85b6822b2
hash.c (mrb_hash_aset): avoid slower mrb_get_args()
2023-08-26 22:30:20 +09:00
Yukihiro "Matz" Matsumoto
0578e518e6
src/vm.c: adjust mrb_gc_protect() for kdict argument
...
It was called repeatedly in some cases.
2023-08-25 23:12:08 +09:00
Yukihiro "Matz" Matsumoto
1e385692d1
Rakefile: remove default build target directories in deep_clean
...
Ref #6038 , #6032
2023-08-24 12:57:27 +09:00
Yukihiro "Matz" Matsumoto
f43f2fc8f3
mruby-socket/socket.c: use internal name for instance variables
...
For Socket::Option objects.
2023-08-23 11:27:03 +09:00
Yukihiro "Matz" Matsumoto
2160be7db7
mruby-socket/socket.rb: remove unused canonname accessor
2023-08-22 23:27:08 +09:00
Yukihiro "Matz" Matsumoto
95e09c0c95
mruby-method: implement Kernel#singleton method in C
...
- Also fixes error message inconsistency
- Avoid unnecessary method object allocation if possible
2023-08-22 10:53:52 +09:00
Yukihiro "Matz" Matsumoto
a16b2b0e12
Merge pull request #6038 from dearblue/revert-6032-update-rake-task-clean
...
Revert "Rake: update task clean to remove `bin` and `build` folders"
2023-08-21 22:28:17 +09:00
Yukihiro "Matz" Matsumoto
182c06a46b
codedump.c: fflush() output
2023-08-21 17:27:03 +09:00
Yukihiro "Matz" Matsumoto
982a378425
mruby-print/print.c: stop flushing every time in printstr
...
Instead, call `fflush` at the end of `print` method, if stdout is
connected to a tty.
2023-08-21 12:47:44 +09:00
Yukihiro "Matz" Matsumoto
192e6e3b9f
mruby-print/print.c: remove internal method __printstr
...
Instead, implement `print` method in C and use it from mrblib/print.rb
2023-08-21 12:47:44 +09:00
dearblue
14a0cc4b7b
Revert "Rake: update task clean to remove bin and build folders"
2023-08-18 22:36:21 +09:00
Yukihiro "Matz" Matsumoto
bd41dfbcb9
mruby-socket/socket.c (socket_option_inspect): readable family name
...
Print readable name for know protocol families.
2023-08-17 10:54:59 +09:00
Yukihiro "Matz" Matsumoto
2fb478db76
Merge pull request #6037 from mruby/dependabot/github_actions/super-linter/super-linter-5.2.1
...
build(deps): bump super-linter/super-linter from 5.2.0 to 5.2.1
2023-08-17 10:53:10 +09:00
dependabot[bot]
1dbfeab2df
build(deps): bump super-linter/super-linter from 5.2.0 to 5.2.1
...
Bumps [super-linter/super-linter](https://github.com/super-linter/super-linter ) from 5.2.0 to 5.2.1.
- [Release notes](https://github.com/super-linter/super-linter/releases )
- [Changelog](https://github.com/super-linter/super-linter/blob/main/docs/release-process.md )
- [Commits](https://github.com/super-linter/super-linter/compare/v5.2.0...v5.2.1 )
---
updated-dependencies:
- dependency-name: super-linter/super-linter
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com >
2023-08-16 14:29:51 +00:00
Yukihiro "Matz" Matsumoto
58e10f16e9
mruby-socket/socket.c: include Socket::Constants in C init
2023-08-16 13:23:56 +09:00
Yukihiro "Matz" Matsumoto
1d7c00e920
mruby-socket/socket.c: implement whole Socket::Option class in C
...
`mruby-pack` gem no longer needed.
2023-08-15 15:29:36 +09:00
Yukihiro "Matz" Matsumoto
83b6a63c16
mruby-socket/socket.c: implement accessors in C
2023-08-15 07:35:29 +09:00
Yukihiro "Matz" Matsumoto
e209f0a220
mruby-socket/socket.c (socket_option_init): add integer type checks
2023-08-15 07:31:04 +09:00
Yukihiro "Matz" Matsumoto
892596d372
mruby-socket/socket.c: implement Socket::Option#initialize in C
2023-08-14 23:32:22 +09:00
Yukihiro "Matz" Matsumoto
2a3af5dc67
Merge pull request #6036 from jbampton/add-pre-commit-hook
...
pre-commit: add hook `forbid-submodules`
2023-08-13 22:05:20 +09:00
Yukihiro "Matz" Matsumoto
d53aa54e3b
Merge pull request #6035 from jbampton/fix-super-linter-path
...
Fix Super-Linter action path
2023-08-13 22:04:33 +09:00
Yukihiro "Matz" Matsumoto
3310e10318
mruby-test/mrbgem.rake: fix mrb_state handling bug
...
You should not pass values from different mrb_state. No one has ever
used test_args for gems, the issue has not been realized.
2023-08-13 20:02:01 +09:00
John Bampton
6ac6d690dd
pre-commit: add hook forbid-submodules
...
https://github.com/pre-commit/pre-commit-hooks#forbid-submodules
If you want to ban them entirely use forbid-submodules.
Really this is just one extra check or test we can have.
2023-08-13 11:17:22 +10:00
John Bampton
9051367fd8
Fix Super-Linter action path
...
https://github.com/super-linter/super-linter
https://github.com/marketplace/actions/super-linter
They changed the organization name to "super-linter" from "github" for the Super-Linter Action
2023-08-13 11:03:28 +10:00
Yukihiro "Matz" Matsumoto
4769a474a4
mruby-test/mrbgem.rake: remove unnecessary arena_index
2023-08-12 23:43:48 +09:00
Yukihiro "Matz" Matsumoto
435cce7efd
mruby-socket/socket.c: use mrb_iv_get() instead of accessors
2023-08-12 20:19:32 +09:00
Yukihiro "Matz" Matsumoto
c675c0cbb1
mruby-socket/socket.c: use mrb_ensure_int_type()
2023-08-11 23:10:02 +09:00
Yukihiro "Matz" Matsumoto
34e7a0ef4b
mruby-socket/socket.c (socket_option_class): a new function
...
To retrieve Socket::Option class from C functions.
2023-08-11 23:07:38 +09:00
Yukihiro "Matz" Matsumoto
0864f44c24
mruby-socket/socket.c: use mrb_obj_new() instead of mrb_obj_funcall()
2023-08-09 18:45:42 +09:00
Yukihiro "Matz" Matsumoto
08a780edd6
mruby-socket/socket.c: rename a local variable for clarity (res0 -> addr)
2023-08-09 14:33:14 +09:00
Yukihiro "Matz" Matsumoto
edf3f1226c
mruby-socket/socket.c: pass klass to gen_addrinfo
2023-08-09 14:33:14 +09:00
Yukihiro "Matz" Matsumoto
9e37a490f8
mruby-socket/socket.c: narrow local variable scope
2023-08-09 14:33:14 +09:00
Yukihiro "Matz" Matsumoto
10ed2ea03b
mruby-socket/socket.c: use z! argument specifier rather than o
...
`z!` specifier checks if the argument is NULL terminated string or nil.
2023-08-09 14:33:14 +09:00
Yukihiro "Matz" Matsumoto
9d370e0851
mruby-socket/socket.c: ensure struct addrinfo to be freed
...
Instead of referring the last addrinfo via Addrinfo's class variable, we
use `mrb_ensure()` from `mruby-error` gem.
2023-08-09 13:51:25 +09:00
Yukihiro "Matz" Matsumoto
12bd395012
fmt_fp.c: revert 647324ad45c0d779a3c36f0bb7955b8b8fc9f491
...
C++ complier does not allow jump across local variable declaration, even
if we don't access those variables after the destination label.
2023-08-08 11:24:15 +09:00
Yukihiro "Matz" Matsumoto
8591211494
dump.c (mrb_dump_irep): remove a function which only delegates
2023-08-08 11:24:14 +09:00
Yukihiro "Matz" Matsumoto
ceb5086eb3
fmt_fp.c: unify returning code
2023-08-08 11:24:14 +09:00
Yukihiro "Matz" Matsumoto
7e865aec51
mruby-bigint/bigint.c: remove unused mrb_bint_new()
2023-08-08 11:24:14 +09:00
Yukihiro "Matz" Matsumoto
a22ea766e2
mruby-numeric-ext/numeric_ext.c: use local variables.
2023-08-08 11:24:14 +09:00
Yukihiro "Matz" Matsumoto
5de3be1bee
mruby-dir/dir.c (mrb_di_getwd): reduce buffer allocation size
...
Instead of allocating `MAXPATHLEN` buffer string at the beginning,
allocate smaller (64 bytes) buffer, then resize it if needed. The
allocating max size is safe but consumes more memory.
2023-08-08 11:24:14 +09:00
Yukihiro "Matz" Matsumoto
a2649652f1
mruby-os-memsize/memsize.c: fix irep size calculation
...
Need to count the following as well:
- size of pool values
- size of reps array
2023-08-02 07:04:35 +09:00
Yukihiro "Matz" Matsumoto
1bc8ef903e
Merge pull request #6032 from jbampton/update-rake-task-clean
...
Rake: update task clean to remove `bin` and `build` folders
2023-07-31 10:42:01 +09:00
Yukihiro "Matz" Matsumoto
0af6f8ff57
Merge pull request #6033 from jbampton/file-sorter-unique
...
pre-commit: file-contents-sorter ensure each line is unique
2023-07-30 18:30:26 +09:00
John Bampton
a2785a8180
pre-commit: file-contents-sorter ensure each line is unique
...
https://github.com/pre-commit/pre-commit-hooks#file-contents-sorter
2023-07-30 04:25:38 +10:00
John Bampton
a94a8b1cf0
Rake: update task clean to remove bin and build folders
2023-07-30 03:51:48 +10:00
Yukihiro "Matz" Matsumoto
bbd4edc607
mruby-data/data.c (mrb_data_ref): remove code duplication
2023-07-29 08:42:25 +09:00
Yukihiro "Matz" Matsumoto
8d2f9b3d12
mruby-data/data.c: skip inefficient env for first some accessors
2023-07-28 23:45:25 +09:00
Yukihiro "Matz" Matsumoto
1e1184f62d
mruby-pack/pack.c (read_tmpl): should consume skips in the function
2023-07-28 17:05:49 +09:00
Yukihiro "Matz" Matsumoto
0542d6bad4
debug.c (mrb_packed_int_encode): remove end argument
...
The function requires the buffer bigger than `mrb_packed_int_len()`
anyway, so we don't need boundary checks for each iteration. Should
makes the function a little bit faster.
2023-07-28 17:05:38 +09:00
Yukihiro "Matz" Matsumoto
5b2056efda
Merge pull request #6031 from jbampton/pre-commit-autoupdate
...
Run `pre-commit autoupdate` and update `codespell.txt`
2023-07-25 10:57:03 +09:00
John Bampton
0464ca3870
Run pre-commit autoupdate
2023-07-24 22:26:53 +10:00
John Bampton
b66b67beda
Update codespell.txt
2023-07-24 22:25:03 +10:00
Yukihiro "Matz" Matsumoto
1535e031df
mruby-pack/pack.c (read_tmpl): direct return from skipping directives
...
We used to read counts after spaces, for example `pack("j 4")` read `4`
as counts after a space.
2023-07-24 18:03:39 +09:00
Yukihiro "Matz" Matsumoto
a5a13ad35f
mruby-pack/pack.c (read_tmpl): read_tmpl to return dir
...
Use return value for directives information.
2023-07-24 18:03:39 +09:00
Yukihiro "Matz" Matsumoto
8a3d52f494
mruby-pack/pack.c (read_tmpl): rename PACK_DIR_INVALID
...
The value is used for spaces and comments, so the term "skip" is more
appropriate than "invalid".
2023-07-24 18:03:38 +09:00
Yukihiro "Matz" Matsumoto
e17f3256c6
mruby-pack/pack.c (read_tmpl): support comments in derectives
2023-07-24 18:03:38 +09:00
Yukihiro "Matz" Matsumoto
5d0016186f
numeric.c (mrb_float_to_str): avoid memcpy()
2023-07-24 18:03:38 +09:00
Yukihiro "Matz" Matsumoto
0eceadd037
mruby-pack/test/pack.rb: test B/b directives
2023-07-24 18:03:38 +09:00
Yukihiro "Matz" Matsumoto
e7021f190a
mruby-pack/pack.c (pack_bstr): support B/b directives
2023-07-24 18:03:38 +09:00
Yukihiro "Matz" Matsumoto
05549410d9
mruby-pack/pack.c (read_tmpl): check unknown directives
2023-07-24 18:03:38 +09:00
Yukihiro "Matz" Matsumoto
2a1e3a572c
mruby-pack/pack.c (read_tmpl): support J/j template in pack
...
J/j is available since Ruby 2.3.
2023-07-24 18:03:37 +09:00
Yukihiro "Matz" Matsumoto
663f936ba8
Merge pull request #6030 from jbampton/standardize-dots
...
Standardize docs to use 3 dots: `...`
2023-07-24 08:21:16 +09:00
Yukihiro "Matz" Matsumoto
0876cf82ff
Merge pull request #6028 from jbampton/fix-super-linter-button
...
Fix Super-Linter button in README
2023-07-24 08:20:06 +09:00
John Bampton
14b4f5953b
Standardize docs to use 3 dots: ...
2023-07-23 03:39:03 +10:00
Yukihiro "Matz" Matsumoto
455a5689f3
lib/mruby/build/command.rb: skip mrbgems in parent directory; fix #6029
...
If `mrbgems` is included in the parent directory path (MRUBY_ROOT), it
confuses gem path and build path.
2023-07-17 13:24:47 +09:00
Yukihiro "Matz" Matsumoto
f84f129d65
AUTHORS: update entries [ci skip]
2023-07-17 12:18:10 +09:00
Yukihiro "Matz" Matsumoto
5e7d763e91
variable.c (mrb_obj_iv_set_force): check namespace_p beforehand
...
To reduce number of assign_class_name() invocation.
2023-07-17 12:09:28 +09:00
John Bampton
95fbacb1dc
Fix Super-Linter button in README
...
Updated the button to the latest format seen here:
https://github.com/marketplace/actions/super-linter#add-super-linter-badge-in-your-repository-readme
2023-07-15 20:49:58 +10:00
Yukihiro "Matz" Matsumoto
82a48bd455
error.c (mrb_bug): avoid formatting in mrb_bug()
...
Since mrb_bug() would be called under the abnormal situation (and should
not be called if possible), the process should be minimal.
2023-07-14 21:48:11 +09:00
Yukihiro "Matz" Matsumoto
d6d434eb3f
Inline loop variables everywhere
2023-07-13 08:05:00 +09:00
Yukihiro "Matz" Matsumoto
d4a03be96b
mruby-string-ext/string.c (str_casecmp): small refactoring
2023-07-12 09:14:45 +09:00
Yukihiro "Matz" Matsumoto
2af0ff52e9
backtrace.c (count_backtrace_i): remove empty callback
...
Instead specifying NULL as function argument of each_backtrace()
count the number of callbacks.
2023-07-11 07:17:19 +09:00
Yukihiro "Matz" Matsumoto
6f99806d5b
backtrace.c (packed_backtrace): remove count_backtrace()
...
Since we have stop calling mrb_debug_get_position() in each_backtrace(),
we don't need to craft special function count_backtrace(). We just use
each_backtrace() to count the number of backtraces.
2023-07-11 06:59:09 +09:00
Yukihiro "Matz" Matsumoto
316119069d
backtrace.c (each_backtrace): skip callinfo without debug_info
2023-07-10 07:57:02 +09:00
Yukihiro "Matz" Matsumoto
7aa914b4d4
cdump.c (cdump_debug): restore arena index at the end of the function
2023-07-10 07:26:19 +09:00
Yukihiro "Matz" Matsumoto
c57610ad8a
backtrace.c (packed_backtrace): fix broken ciidx
...
- fix at higher level to remove redundancy
- ciidx should always be smaller than ci stack length
2023-07-10 07:05:27 +09:00
Yukihiro "Matz" Matsumoto
9c61c66045
gc.c (mrb_obj_alloc): clarify the heap initialization
2023-07-09 22:59:58 +09:00
Yukihiro "Matz" Matsumoto
eebbc6eaa4
gc.c (mrb_obj_alloc): gc->heaps may be NULL
2023-07-07 06:53:19 +09:00
Yukihiro "Matz" Matsumoto
af85b1fbed
gc.c (gc_mark_gray_list): cut gcnext link
2023-07-06 22:57:14 +09:00
Yukihiro "Matz" Matsumoto
aa5ffb686f
mruby-os-memsize: more precise memory size for method tables
2023-07-06 16:12:51 +09:00
Yukihiro "Matz" Matsumoto
0a4473bf64
mruby-socket/socket.c: fix indentation
2023-07-04 17:50:37 +09:00
Yukihiro "Matz" Matsumoto
0558b1abd8
backtrace.c: reorder functions for clarity
2023-07-03 15:26:45 +09:00
Yukihiro "Matz" Matsumoto
97b60e7fb1
backtrace.c (backtrace_location): defer retrieving positions
...
Instead of calling `mrb_debug_get_position` in the `each_backtrace`, we
just keep `irep` and `idx` information in the backtrace_location, and
get the exact position in `mrb_unpack_backtrace` which may not be called
if exceptions are handled in the `rescue` clauses.
2023-07-03 15:21:16 +09:00
Yukihiro "Matz" Matsumoto
40bdd65ce6
backtrace.c (each_backtrace): return number of traces iterated
2023-07-03 15:20:24 +09:00
Yukihiro "Matz" Matsumoto
70b49eaef2
debug.c (debug_get_line): remove obsolete debug line types
...
- mrb_debug_line_ary
- mrb_debug_line_flat_map
Those two are no longer used, so we can safely remove the support.
2023-07-03 15:16:29 +09:00
Yukihiro "Matz" Matsumoto
ea649e70b8
mruby-pack/pack.c (mrb_pack_pack): use direct array buffer access
...
We don't need index wrap-around not boundary check here, so we can use
faster direct array access.
2023-06-29 22:54:58 +09:00
Yukihiro "Matz" Matsumoto
0c4f5a4093
backtrace.c (mrb_unpack_backtrace): make the function static
2023-06-29 22:54:09 +09:00
Yukihiro "Matz" Matsumoto
e563a3cb2c
backtrace.c (packed_backtrace): reduce unnecessary calls
...
Instead of calling each_backtrace() twice, use a new function
count_backtrace().
2023-06-28 21:53:17 +09:00
Yukihiro "Matz" Matsumoto
f1d6af08cf
gc.c: inline heap page linkage
2023-06-27 15:48:33 +09:00
Yukihiro "Matz" Matsumoto
38b9a25e83
gc.c (mrb_obj_alloc): remove free_next,free_prev from heap pages
...
It used to be maintain heap pages with allocatable objects (free_heaps)
but we can save two words (16 bytes) per page by scanning live heap pages.
2023-06-27 15:48:25 +09:00
Yukihiro "Matz" Matsumoto
695ad6ea95
gc.c (incremental_sweep_phase): freed need not to be smaller than page size
2023-06-26 17:14:43 +09:00
Yukihiro "Matz" Matsumoto
b2110c23a1
Merge pull request #6023 from dearblue/expose-headers
...
"expose_header_files" task split per build
2023-06-24 15:35:31 +09:00
Yukihiro "Matz" Matsumoto
a3365d8b3f
gc.c (obj_free): need not to unshare env object when freeing fibers
...
Since when env objects reference the context, we no longer need to
unshare (stack reallocate) env objects. Currently all env objects
referenced from fibers are already recycled, so we removed unnecessary
code altogether.
2023-06-23 23:06:15 +09:00
Yukihiro "Matz" Matsumoto
fc9fffc5b5
kernel.rb (_inspect): _inspect method no longer needed
2023-06-22 23:32:31 +09:00
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
dearblue
fdec32a8f2
"expose_header_files" task split per build
...
If there are multiple build targets, it should be preferable to have the task processed at each of them.
2023-06-18 21:22:31 +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
Yukihiro "Matz" Matsumoto
8b39a7825d
Reduce unnecessary mrb_obj_ptr() to mrb_check_frozen()
2023-05-31 08:29:12 +09:00
Yukihiro "Matz" Matsumoto
afcf7fc86d
object.h: make GC color uint8_t that fits in 3 bits
2023-05-31 08:27:23 +09:00
Yukihiro "Matz" Matsumoto
8873229312
codedump.c: fix indentation of OP_SCLASS
2023-05-30 16:08:38 +09:00
Yukihiro "Matz" Matsumoto
6eedf1065d
numeric.c (flo_idiv): add mrb_check_num_exact
2023-05-30 08:54:44 +09:00
Yukihiro "Matz" Matsumoto
795044f82c
internal.h: add mrb_check_num_exact prototype to the header
2023-05-30 08:54:05 +09:00
Yukihiro "Matz" Matsumoto
e84060a900
string.c: rename function str_check_too_big -> str_check_length
2023-05-30 08:40:16 +09:00
Yukihiro "Matz" Matsumoto
f813b5d1d8
string.c (str_new): add string length check
2023-05-29 23:18:44 +09:00
Yukihiro "Matz" Matsumoto
aecaaf011f
string.c (mrb_str_resize): refactor string length check
2023-05-29 23:18:19 +09:00
Yukihiro "Matz" Matsumoto
0a6e1c0ffe
class.c (copy_class): copy source flags as well (except frozen flag)
2023-05-29 22:59:05 +09:00
Yukihiro "Matz" Matsumoto
c0c4219b25
class.c (copy_class): avoid copying method table in some cases
...
To prevent memory leaks
2023-05-29 22:57:59 +09:00
Yukihiro "Matz" Matsumoto
bba2fd84ea
class.h: instance type should occupy 5 bits in flags
2023-05-29 09:27:08 +09:00
Yukihiro "Matz" Matsumoto
e4e3740688
class.c (init_copy): add an assertion
2023-05-29 09:26:45 +09:00
Yukihiro "Matz" Matsumoto
a02894afa3
small cosmetic changes
2023-05-29 09:26:45 +09:00
Yukihiro "Matz" Matsumoto
0ffe9b987a
class.c (mrb_prepend_module): c should not be MRB_TT_ICLASS
2023-05-29 09:26:44 +09:00
Yukihiro "Matz" Matsumoto
6ac10a01e4
Merge pull request #6014 from dearblue/setup_debug.1
...
Fixed visibility of `MRuby::Command::Compiler#setup_debug`
2023-05-29 09:26:32 +09:00
dearblue
a7bee69452
Fixed visibility of MRuby::Command::Compiler#setup_debug
...
In #5977 it was incorrectly set to `private`.
2023-05-26 21:37:29 +09:00
Yukihiro "Matz" Matsumoto
7f887f1928
class.c (mrb_class_initialize): check duplicated initialization
2023-05-26 12:48:34 +09:00
Yukihiro "Matz" Matsumoto
8914c2318c
Merge pull request #6013 from CaptainJet/master
...
Fix Android toolchain
2023-05-26 12:47:08 +09:00
Robert Rowe
fb727a169f
Spacing fix
2023-05-25 19:47:32 -07:00
Robert Rowe
bcb5674676
Update Android building
...
New minimum SDK. NDK longer supports mips, plain armeabi, nor GCC. Fix tooling.
2023-05-25 19:45:14 -07:00
Yukihiro "Matz" Matsumoto
2ad3f0e34b
vm.c (mrb_yield_with_class): keep mid of the callee
...
Otherwise `super` from within blocks may call wrong methods.
2023-05-26 11:17:51 +09:00
Yukihiro "Matz" Matsumoto
9040baa270
vm.c (mrb_yield_with_class): avoid redundant initialization of mid
2023-05-26 11:14:58 +09:00
Yukihiro "Matz" Matsumoto
2b3ecef66c
mruby-data/data.c: use mrb_ary_ref instead of direct memory access
...
Avoid out-of-bound memory access when actual data object size is smaller
than the number of data members.
2023-05-25 09:05:03 +09:00
Yukihiro "Matz" Matsumoto
9bc9ff771d
mruby-data/data.c (mrb_data_s_def): simplify the code
2023-05-25 09:05:03 +09:00
Yukihiro "Matz" Matsumoto
05f4831751
mruby-data/data.c (mrb_data_s_def): add member duplication check
2023-05-25 09:05:03 +09:00
Yukihiro "Matz" Matsumoto
eeab289f87
mruby-data/data.c (mrb_data_ref): avoid out-of-bound access
2023-05-25 09:05:02 +09:00
Yukihiro "Matz" Matsumoto
de69190df5
mruby-struct/struct.c: need to copy the argument array
...
Just in case for stack reallocations.
2023-05-25 09:05:02 +09:00
Yukihiro "Matz" Matsumoto
e05ac91217
mruby-struct/struct.c: update the behavior when actual size differs
...
Assertions may be false and terminate the whole process when actual size
for struct objects are different.
2023-05-25 09:05:02 +09:00
Yukihiro "Matz" Matsumoto
f50e40f291
mruby-struct/struct.c: use mrb_ary_set to simplify the code
...
We don't need to do `mrb_struct_modify()` and calling write barriers by
ourselves for the small performance issue.
2023-05-25 09:05:02 +09:00
Yukihiro "Matz" Matsumoto
0295e6a688
mruby-struct/struct.c (struct_aref_int): update index check
...
Check should use the number of members, not the actual size of the
struct object, which may be smaller than the declared size.
2023-05-25 08:40:46 +09:00
Yukihiro "Matz" Matsumoto
8e579e6552
mruby-data/data.c (mrb_data_ref): check if reader has no argument
2023-05-24 22:45:35 +09:00
Yukihiro "Matz" Matsumoto
ed5fbb5d63
mruby-struct.c (mrb_struct_s_def): check duplicate members
2023-05-24 22:43:09 +09:00
Yukihiro "Matz" Matsumoto
f80192e8ac
mruby-struct/struct.c (struct_s_member): avoid break
...
Direct `return` is more readable, IMO.
2023-05-24 17:59:32 +09:00
Yukihiro "Matz" Matsumoto
c2f3f103bb
mruby-struct/struct.c (mrb_struct_ref): update the function
...
- use `num_members`
- ensure the function takes no argument
- avoid out-of-bound access when struct is failed to initialize
2023-05-24 17:53:41 +09:00
Yukihiro "Matz" Matsumoto
69d33de527
mruby-struct/struct.c (num_members): simplify the code by new argument
2023-05-24 17:51:44 +09:00
Yukihiro "Matz" Matsumoto
52fb2f59d8
mruby-struct/struct.c (struct_aref_sym): simplify the logic
2023-05-24 17:51:03 +09:00
Yukihiro "Matz" Matsumoto
7b7ea70b84
mruby-struct/struct.c (mrb_struct_to_h): RSTRUCT_PTR() may be NULL
...
Especially when you define a member named `initialize`.
2023-05-24 17:48:51 +09:00
Yukihiro "Matz" Matsumoto
53de96426a
mruby-io/io.c (io_init): File.new should not take blocks
2023-05-23 15:34:37 +09:00
Yukihiro "Matz" Matsumoto
67187881c2
mruby-io/io.c (io_init_copy): copy flags before io_buf_init()
2023-05-23 15:17:13 +09:00
Yukihiro "Matz" Matsumoto
8f745b7728
vm.c (OP_ENTER): fix issues by unreferenced kdict and blk
...
There's short a period where kdict and blk are not pointed from the stack.
2023-05-23 14:54:36 +09:00
Yukihiro "Matz" Matsumoto
2f7f797473
remove extra spaces before ;
2023-05-22 12:05:35 +09:00
Yukihiro "Matz" Matsumoto
6a6c0869dc
add a space between for and (
2023-05-22 11:58:23 +09:00
Yukihiro "Matz" Matsumoto
f1a3cfbd3b
add a space between if and (
2023-05-22 11:55:21 +09:00
Yukihiro "Matz" Matsumoto
c32f7915fb
reformat else clause indentation style
2023-05-20 00:21:01 +09:00
Yukihiro "Matz" Matsumoto
eea72ec84a
fix spaces in the type cast expressions (cosmetic changes)
2023-05-18 23:29:16 +09:00
Yukihiro "Matz" Matsumoto
cead78b394
variable.c (iv_rehash): fixed removed check
...
This check removed in 70cc2cc was necessary.
2023-05-17 09:52:00 +09:00
Yukihiro "Matz" Matsumoto
49927a7035
mruby-biding/binding.c: unify get_line and get_filename
2023-05-16 23:40:53 +09:00
Yukihiro "Matz" Matsumoto
15be2a24c3
mruby-proc-ext/proc.c: unify get_line and get_filename
2023-05-16 23:39:51 +09:00
Yukihiro "Matz" Matsumoto
5ead26be3d
vm.c (ci_bidx): inline the function if possible
2023-05-16 22:41:32 +09:00
Yukihiro "Matz" Matsumoto
b10c99bb1b
Merge pull request #6012 from sinisterchipmunk/allow-to-skip-tests-for-specific-mgems
...
Allow tests to be disabled for specific gems; warn about disabled tests
2023-05-16 14:36:40 +09:00
Colin MacKenzie IV
1a0c31130c
Allow tests to be disabled for specific gems; warn about disabled tests
2023-05-15 12:43:37 -04:00
Yukihiro "Matz" Matsumoto
33bd6caf31
Merge pull request #6011 from dearblue/presym-escape
...
Encode and decode escape characters for presym
2023-05-15 00:15:40 +09:00
dearblue
03a42b52ee
Encode and decode escape characters for presym
...
The purpose is to deal with `$"`, which has been treated as three characters including the escape character.
2023-05-14 17:54:13 +09:00
Yukihiro "Matz" Matsumoto
cd276715f8
variable.c: move inline function before usage
2023-05-13 22:52:39 +09:00
Yukihiro "Matz" Matsumoto
f210d3b106
Merge pull request #6010 from jbampton/add-hook-markdown-link-check
2023-05-12 23:31:34 +09:00
John Bampton
ac0e157b89
pre-commit: add hook markdown-link-check
...
https://github.com/tcort/markdown-link-check
2023-05-11 12:37:38 +10:00
John Bampton
de0779d6ca
docs: fix links in Markdown
2023-05-11 12:34:59 +10:00
Yukihiro "Matz" Matsumoto
3d5cc1ab8f
Merge pull request #6007 from dearblue/define_installer
...
Correct the `MRuby::Build#define_installer`
2023-05-10 23:54:27 +09:00
Yukihiro "Matz" Matsumoto
2217201603
Merge pull request #6006 from dearblue/mrbc-final_mrbgems
...
Remove `mrb_final_mrbgems()` in `mrbc.c`
2023-05-09 14:46:51 +09:00
Yukihiro "Matz" Matsumoto
568a7edf1f
Merge pull request #6004 from jbampton/add-info-links-to-workflows
...
yml: document `workflows` with links as comments
2023-05-09 14:45:48 +09:00
Yukihiro "Matz" Matsumoto
feb07d1d1a
Merge pull request #6002 from jbampton/standardize-whitespace-spec-authors
...
mrbgems: standardize `spec.authors` for whitespace and author name
2023-05-08 17:01:23 +09:00
Yukihiro "Matz" Matsumoto
d3f030f02a
Merge pull request #5999 from alpha-netzilla/fix_poppen_mode
...
lib/mruby/build/command.rb: narrow down poppen mode
2023-05-08 17:00:28 +09:00
Yukihiro "Matz" Matsumoto
e545ec3810
Merge pull request #6001 from jbampton/update-docs
...
docs: fix links, grammar and spelling in Markdown
2023-05-08 17:00:03 +09:00
Yukihiro "Matz" Matsumoto
599982454e
Merge pull request #6008 from dearblue/bintest-dirfree
2023-05-07 19:10:59 +09:00
Yukihiro "Matz" Matsumoto
727d83c118
Merge pull request #6009 from dearblue/ghost-bintest
...
Avoid adding `<MRUBY_ROOT>/bintest` which does not exist
2023-05-06 22:28:41 +09:00
dearblue
5a4c319dd8
Avoid adding <MRUBY_ROOT>/bintest which does not exist
...
The `<MRUBY_ROOT>/bintest` directory does not exist in current mruby.
2023-05-06 22:08:48 +09:00
dearblue
eb4c7d0edf
Make "bintest" independent of directory
...
Previously, "bintest" would fail to run unless `MRUBY_ROOT` and `Dir.pwd` were the same.
2023-05-06 22:00:57 +09:00
dearblue
44f9fa1b61
Correct the MRuby::Build#define_installer
...
This is a complement to #5928 .
The previous PR had the following problem:
- The `<INSTALL_DIR>/bin/*` file could not be replaced if the destination of the symbolic link was lost.
- The wrong link destination was written if `MRuby::Build.install_dir` was a relative path.
2023-05-06 21:54:49 +09:00
dearblue
e570ca82a8
Remove mrb_final_mrbgems() in mrbc.c
...
The current `mrb_final_mrbgems()` function is only referenced in the `mrbgem/gem_init.c` file.
Also, the definition in that file makes it a static function.
2023-05-06 21:07:08 +09:00
John Bampton
04a120f7c2
yml: document workflows with links as comments
2023-05-06 08:31:20 +10:00
Yukihiro "Matz" Matsumoto
9033191efa
Merge pull request #6003 from jbampton/label-more-files
...
`.github/labeler.yml`: label more files for `doc`
2023-05-06 06:43:53 +09:00
John Bampton
5fab261d8a
.github/labeler.yml: label more files for doc
2023-05-06 07:19:46 +10:00
John Bampton
63e170170e
mrbgems: standardize spec.authors for whitespace and author name
2023-05-06 06:06:29 +10:00
John Bampton
db3774ea45
docs: fix links, grammar and spelling in Markdown
2023-05-06 04:43:50 +10:00
John Bampton
d63115a0f1
docker: use less image layers and update compose version
...
https://stackoverflow.com/questions/30256386/how-to-copy-multiple-files-in-one-layer-using-a-dockerfile
https://docs.docker.com/compose/compose-file/compose-file-v3/
2023-05-06 01:46:51 +10:00
Yukihiro "Matz" Matsumoto
9b4046f479
Merge pull request #5961 from jbampton/add-docker
...
Add `Docker` to build and run all `mruby` tests. Run `pre-commit` and generate `YARD` docs with Docker
2023-05-05 22:42:33 +09:00
alpha.netzilla
3409c1f309
lib/mruby/build/command.rb: narrow down poppen mode
2023-05-05 19:23:18 +09:00
Yukihiro "Matz" Matsumoto
28a29c6da1
Merge pull request #5997 from jbampton/pre-commit-autoupdate
...
Run `rake checkupdate` -> `pre-commit autoupdate`
2023-05-04 08:36:36 +09:00
Yukihiro "Matz" Matsumoto
ab0f2297ab
Merge pull request #5996 from jbampton/fix-case-of-mruby
...
Change `MRuby` to `mruby`
2023-05-04 08:34:46 +09:00
John Bampton
be722da0d1
pre-commit autoupdate
...
Run `rake checkupdate`
2023-05-03 22:49:34 +10:00
John Bampton
12f64cc6d9
Update codespell.txt. Disable markdownlint rule MD052
2023-05-03 22:44:58 +10:00
John Bampton
06a765a1c2
Change MRuby to mruby
2023-05-03 22:12:59 +10:00
Yukihiro "Matz" Matsumoto
5956496267
lib/mruby/build/command.rb: remove unnecessary block parameter; fix #5995
2023-05-03 12:41:52 +09:00
Yukihiro "Matz" Matsumoto
077d8ad514
symbol.c (sym_intern): check NUL before calling strlen()
...
To avoid accidental buffer overrun if a string without NUL termination
is provided.
2023-05-02 09:45:47 +09:00
Yukihiro "Matz" Matsumoto
19b2c1c73d
symbol.c: remove unused macro
2023-05-02 09:45:23 +09:00
Yukihiro "Matz" Matsumoto
7fd3108201
README.md: update English description (used ChatGPT)
2023-05-02 09:44:49 +09:00
Yukihiro "Matz" Matsumoto
7154526c04
Merge pull request #5994 from masahino/fix_typo_in_io_c
...
fix typo in mrbgems/mruby-io/src/io.c
2023-05-02 09:44:13 +09:00
masahino
ad318e55c0
fix typo MRB_NO_IO_POEPN -> MRB_NO_IO_POPEN
2023-05-02 07:34:30 +09:00
Yukihiro "Matz" Matsumoto
b488f197c5
Merge pull request #5992 from dearblue/doc/directory
...
Replace "folder" with "directory" for consistency
2023-04-30 23:19:40 +09:00
Yukihiro "Matz" Matsumoto
abd1222089
class.h (mrb_class): treat immediate values first
2023-04-30 23:19:00 +09:00
dearblue
5c19b259e4
Replace "folder" with "directory" for consistency
...
Also, use "x/y/z directory" instead of "directory x/y/z" if there is no problem.
2023-04-30 18:32:54 +09:00
Yukihiro "Matz" Matsumoto
70cc2cc173
variable.c (iv_rehash): remove unnecessary checks
2023-04-29 23:17:08 +09:00
Yukihiro "Matz" Matsumoto
5024c3453d
variable.c (iv_put): remove NULL check since t must not be NULL
2023-04-27 17:14:48 +09:00
Yukihiro "Matz" Matsumoto
68d67aee0e
mruby-io/io.c: need to adjust buffer limit before searching; fix #5991
2023-04-26 09:09:05 +09:00
Yukihiro "Matz" Matsumoto
01e5f2a3c8
mruby-io/io.c: fix indent
2023-04-25 23:27:59 +09:00
Yukihiro "Matz" Matsumoto
9a5a9b814f
mruby-catch/catch.c: remove mrb_ prefix from a static function
2023-04-25 23:27:30 +09:00
Yukihiro "Matz" Matsumoto
e0194bba67
mruby-string-ext/string.c: remove mrb_ prefix from static functions
2023-04-25 14:25:15 +09:00
Yukihiro "Matz" Matsumoto
62e8f047b9
mruby-sleep/sleep.c: remove mrb_ prefix from static functions
2023-04-24 12:19:12 +09:00
Yukihiro "Matz" Matsumoto
f116808d80
Merge pull request #5435 from jbampton/add-github-pr-labeler
...
Add the pull request labeler Action
2023-04-23 23:50:06 +09:00
Yukihiro "Matz" Matsumoto
49b887d75f
mruby-object-ext/object.c: remove mrb_ prefix from static functions
2023-04-20 22:40:10 +09:00
Yukihiro "Matz" Matsumoto
2810491587
mruby-class-ext/class.c: remove mrb_ prefix from static functions
2023-04-19 00:12:28 +09:00
Yukihiro "Matz" Matsumoto
c1010624a4
Merge pull request #5989 from dearblue/integrate-eval
...
Integrate `mruby-binding-eval` into `mruby-eval`
2023-04-19 00:06:13 +09:00
Yukihiro "Matz" Matsumoto
ac7e63ab3b
Merge pull request #5986 from dearblue/bytesplice
...
Fix bugs in `String#bytesplice`
2023-04-17 07:17:00 +09:00
Yukihiro "Matz" Matsumoto
ceabb9cac8
Merge pull request #5988 from dearblue/int-inv
...
Returns the value of `Integer#~` from `mrb_bint_rev()`
2023-04-16 23:55:51 +09:00
dearblue
0e00d8e224
Integrate mruby-binding-eval into mruby-eval
...
Currently mruby-eval depends on mruby-binding (formerly mruby-binding-core).
Also, `Kernel#eval` can accept `binding` objects.
With this in mind, it would be better if `Binding#eval` could also be handled by `mrbgems/mruby-eval`.
2023-04-16 21:44:00 +09:00
Yukihiro "Matz" Matsumoto
a959ce5755
Merge pull request #5985 from dearblue/sign-extension
...
Sign extension with `OP_LOADI32` in `get_int_operand()`
2023-04-15 23:25:07 +09:00
dearblue
0279067dc4
Returns the value of Integer#~ from mrb_bint_rev()
...
fixed #5987
2023-04-15 22:39:05 +09:00
dearblue
8665f88791
Allow an empty string for String#bytesplice
2023-04-15 21:26:01 +09:00
dearblue
59931e95c4
Prohibit string lengths less than 0 in String#bytesplice
2023-04-15 21:26:00 +09:00
dearblue
5bc3a48ecb
Handling negative indices in String#bytesplice
2023-04-15 21:25:59 +09:00
dearblue
dcced0016c
Countermeasure to overflow for String#bytesplice
2023-04-15 21:25:58 +09:00
dearblue
73b6c6619c
Need type check for replace by String#bytesplice
2023-04-15 21:25:57 +09:00
dearblue
2e9ac8f448
Returns self for String#bytesplice
2023-04-15 21:25:56 +09:00
dearblue
c981e151ae
Sign extension with OP_LOADI32 in get_int_operand()
...
Previously, the following code did not give the expected result.
```
% bin/mruby -e 'p "%08X" % ~(-1 << 16)'
"..F0000FFFF"
% ruby32 -e 'p "%08X" % ~(-1 << 24)'
"00FFFFFF"
```
For information: this problem arises in the process of folding numbers through optimisation.
2023-04-15 20:52:43 +09:00
Yukihiro "Matz" Matsumoto
836bebc708
mruby-compar-ext/compar.rb: Comparable#clamp to accept nil as arguments
2023-04-14 01:06:29 +09:00
Yukihiro "Matz" Matsumoto
68c58eac91
Merge pull request #5981 from dearblue/binding-only-ruby
...
`Kernel#binding` responds only to calls from Ruby
2023-04-14 01:06:16 +09:00
Yukihiro "Matz" Matsumoto
c80db85ed5
Merge pull request #5980 from dearblue/binding-noise
...
Remove noise in new `mruby-binding`
2023-04-14 01:05:05 +09:00
Yukihiro "Matz" Matsumoto
4f125a3f19
mruby-struct/struct.c: allow struct size differ from members
...
The situation may be caused by `Struct.new(...).alloc` etc.
2023-04-13 07:39:05 +09:00
Yukihiro "Matz" Matsumoto
8af45425d0
mruby-struct/struct.c: Struct.new should take 1+ arguments
2023-04-13 07:39:05 +09:00
Yukihiro "Matz" Matsumoto
bb7b4b67ae
mruby-struct/struct.c (struct_corrupted): fix error message
2023-04-13 07:39:05 +09:00
Yukihiro "Matz" Matsumoto
a7c96edf6f
mruby-struct/struct.c: prohibit Struct.allocate; ref #5979
2023-04-13 07:39:05 +09:00
Yukihiro "Matz" Matsumoto
9822c843e9
mruby-array-ext/array.c: remove mrb_ prefix from static functions
2023-04-13 07:39:05 +09:00
John Bampton
00d43ad960
Add Docker to build and run all mruby tests
...
Run `pre-commit` and generate `YARD` docs with Docker
Update CONTRIBUTING
2023-04-13 00:12:32 +10:00
John Bampton
976ec87100
Add the pull request labeler Action
...
https://github.com/actions/labeler
https://github.com/marketplace/actions/labeler
Verified Action
Update labeler.yml
2023-04-12 19:25:51 +10:00
Yukihiro "Matz" Matsumoto
8d014e9f43
Merge pull request #5984 from mruby/dependabot/github_actions/github/super-linter-5.0.0
...
build(deps): bump github/super-linter from 4.10.1 to 5.0.0
2023-04-12 09:12:00 +09:00
dependabot[bot]
71e78428ea
build(deps): bump github/super-linter from 4.10.1 to 5.0.0
...
Bumps [github/super-linter](https://github.com/github/super-linter ) from 4.10.1 to 5.0.0.
- [Release notes](https://github.com/github/super-linter/releases )
- [Changelog](https://github.com/github/super-linter/blob/main/docs/release-process.md )
- [Commits](https://github.com/github/super-linter/compare/v4.10.1...v5.0.0 )
---
updated-dependencies:
- dependency-name: github/super-linter
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com >
2023-04-11 14:57:54 +00:00
Yukihiro "Matz" Matsumoto
0df3e68a5d
Merge pull request #5979 from dearblue/allocate-undef
...
Allow `Class#allocate` to be prohibited
2023-04-10 10:45:00 +09:00
dearblue
5cb2764279
Kernel#binding responds only to calls from Ruby
...
This follows the behavior changed in CRuby 3.2.
2023-04-09 21:15:13 +09:00
dearblue
93e07eec1c
Remove noise in new mruby-binding
...
`Binding#eval` should not be defined in `mruby-binding`.
2023-04-09 21:14:33 +09:00
dearblue
d3128ce58a
Allow Class#allocate to be prohibited
...
Calling `Class#allocate` with `UnboundMethod#bind_call` usually succeeds without problems.
If this behavior does not make us happy, we can now prohibit it with `MRB_SET_INSTANCE_TT(klass, MRB_TT_UNDEF)`.
At the same time, it applies to the `Binding`, `Complex`, `Data`, `Float`, `Integer`, `Method`, `Rational` and `UnboundMethod` classes.
2023-04-09 21:14:07 +09:00
Yukihiro "Matz" Matsumoto
c3ba76794f
Merge pull request #5977 from dearblue/setup_debug
...
Make `MRuby::Build#enable_debug` compiler flag setting abstract
2023-04-09 15:51:44 +09:00
dearblue
0f2c1caa96
Make MRuby::Build#enable_debug compiler flag setting abstract
...
Previously, compiler flags were only added for GCC or similar.
The situation has not changed, but it has become easier to improve.
I expect `MRuby::Command::Compiler#setup_debug` to be defined as a singleton method inside the block given to `MRuby::Toolchain.new`.
2023-04-09 11:21:50 +09:00
Yukihiro "Matz" Matsumoto
64536b866b
string.c (str_escape): simplify the logic
2023-04-07 13:53:19 +09:00
Yukihiro "Matz" Matsumoto
d0653ca908
cdump.c: escape filename debug information; fix #5974
...
Windows path separator is "\" so that it needs to be escaped.
2023-04-07 13:51:59 +09:00
Yukihiro "Matz" Matsumoto
27a14f0a9a
vm.c (OP_CMP): fixed wrong numeric comparison for integers; fix #5975
...
MRB_TT_INTEGER value may not be fixnum (immediate integer), so we should
not use mrb_fixnum() here.
2023-04-07 10:46:01 +09:00
Yukihiro "Matz" Matsumoto
761816bf8a
fmt_fp.c (mrb_format_float): change else indentation style
2023-04-06 16:49:08 +09:00
Yukihiro "Matz" Matsumoto
956d0c5127
fmt_fp.c (mrb_format_float): set minimum precision 1 for "%e"
2023-04-06 16:47:43 +09:00
Yukihiro "Matz" Matsumoto
31c99eb99b
debug.c (mrb_debug_get_position): do not keep lp and fp uninitialized
2023-04-06 15:47:24 +09:00
Yukihiro "Matz" Matsumoto
ce86040a0f
Merge pull request #5973 from dearblue/envadjust
...
Small improvements to `envadjust()`
2023-04-06 10:48:49 +09:00
Yukihiro "Matz" Matsumoto
9e4b3af553
Merge pull request #5972 from dearblue/simple-mrb_top_run
...
Simplify `mrb_top_run()`
2023-04-06 10:46:56 +09:00
Yukihiro "Matz" Matsumoto
b4d7b269b0
Merge pull request #5971 from dearblue/simple-raise.2
...
Remove unnecessary branches in `L_RAISE` block
2023-04-06 10:46:02 +09:00
dearblue
17abe548a7
Small improvements to envadjust()
...
- Calculate the difference between `oldbase` and `newbase` only once outside the loop.
- To make sure they are within range, the comparison is done only once instead of twice.
2023-04-05 22:29:27 +09:00
dearblue
b90f59d36e
Simplify mrb_top_run()
2023-04-05 22:11:36 +09:00
dearblue
b46a852acb
Remove unnecessary branches in L_RAISE block
...
The previous `while` loop ends if the catch handler pointer `ch` is not `NULL`.
Supplement to #5843 .
2023-04-05 21:52:21 +09:00
Yukihiro "Matz" Matsumoto
35a3bab369
Merge pull request #5966 from jbampton/add-mruby-debugger
...
Update `default.gembox` add mruby debugger `mrdb`
2023-04-05 15:11:29 +09:00
Yukihiro "Matz" Matsumoto
8e9da2130f
Merge pull request #5968 from jbampton/add-mruby-logo-to-readme
...
Add `mruby` logo to the README
2023-04-05 15:10:26 +09:00
Yukihiro "Matz" Matsumoto
730cbe7c0c
Merge pull request #5969 from jbampton/docs-fix-grammar
...
Fix grammar in `mruby-YOUR-bigint/TODO-HINT.md`
2023-04-05 15:08:44 +09:00
Yukihiro "Matz" Matsumoto
19a2145204
Merge pull request #5970 from jbampton/fix-spelling-of-homepage
...
`README.md` fix spelling: `home-page` -> `homepage`
2023-04-05 15:07:44 +09:00
John Bampton
6467488854
Add mruby logo to the README
...
Center logo, mruby title and linter badge
Fix for YARD and Doxygen output
2023-04-05 15:53:02 +10:00
John Bampton
e9756c77ea
README.md fix spelling: home-page -> homepage
...
https://en.wikipedia.org/wiki/Home_page
2023-04-05 13:39:41 +10:00
John Bampton
ebdb03b4d4
Fix grammar in mruby-YOUR-bigint/TODO-HINT.md
2023-04-05 11:26:05 +10:00
Yukihiro "Matz" Matsumoto
8171edc4eb
Merge pull request #5967 from jbampton/sort-gitignore
...
Sort and remove blank lines from `.gitignore`
2023-04-05 08:05:45 +09:00
John Bampton
076520cac1
Sort and remove blank lines from .gitignore
2023-04-05 03:49:49 +10:00
Yukihiro "Matz" Matsumoto
90e3022936
Merge pull request #5965 from jbampton/fix-word-case-yard
...
Fix word case: `yard` -> `YARD`
2023-04-04 23:12:48 +09:00
John Bampton
b486a3c425
Update default.gembox add mruby debugger mrbd
2023-04-04 19:31:42 +10:00
John Bampton
7082e95fa2
Fix word case: yard -> YARD
...
https://yardoc.org/
2023-04-04 18:20:52 +10:00
Yukihiro "Matz" Matsumoto
b44d757b8c
Merge pull request #5962 from jbampton/code-blocks-add-languages
...
docs: add language `console` to code blocks
2023-04-04 12:09:54 +09:00
Yukihiro "Matz" Matsumoto
76df8d737d
Merge pull request #5960 from dearblue/gem-init-final.2
...
Shrink `<BUILD-DIR>/mrbgems/gem_init.c` if possible
2023-04-04 11:30:21 +09:00
Yukihiro "Matz" Matsumoto
5265e35ad2
mruby-time/time.c: remove mrb_ prefix from static functions
2023-04-03 08:58:33 +09:00
Yukihiro "Matz" Matsumoto
3d2cf0d9bf
mruby-bigint/bigint.c: fix int64/uint64 conversion
...
The functions were totally wrong in digit order and sign treatment. We
didn't notice since they are only called from mruby-time in the m64-i32
configuration.
2023-04-03 08:55:48 +09:00
Yukihiro "Matz" Matsumoto
65897145aa
mruby-time/time.c (mrb_to_time_t): should always initialize usec
2023-04-03 08:46:30 +09:00
Yukihiro "Matz" Matsumoto
875e0b0b59
mruby-time/time.c (time_value_from_time_t): should raise exception
...
When time_t does not fit in mrb_int; ref #5958
2023-04-03 08:38:52 +09:00
Yukihiro "Matz" Matsumoto
dd453080e0
Merge pull request #5958 from dearblue/fixable_time_t_p
...
Need `fixable_time_t_p()` always
2023-04-03 07:34:11 +09:00
John Bampton
f0d6674352
docs: add language console to code blocks
...
https://github.com/github/linguist/blob/79c4aa4706e08f9eb36e46535f0e909f51f3b74d/lib/linguist/languages.yml#L6392
2023-04-03 08:28:59 +10:00
dearblue
73b2e0bf76
Shrink <BUILD-DIR>/mrbgems/gem_init.c if possible
...
If none of the GEMs have `mrblib/` or `src/` directories, generate `mrb_init_mrbgems()` which does nothing, and omit `mrb_final_mrbgems()`.
The impetus was to avoid `gem_funcs[]` becoming a zero-length array, which is not allowed by the C standard.
The problem is caused by #5938 .
2023-04-02 20:28:14 +09:00
Yukihiro "Matz" Matsumoto
c6e7dfe9e5
Merge pull request #5959 from dearblue/mruby-strip
...
Need a dependency to `mruby-compiler` for `mruby-bin-strip`
2023-04-02 08:58:58 +09:00
dearblue
96190dba59
Need a dependency to mruby-compiler for mruby-bin-strip
...
It uses `mrb_irep_remove_lv()` defined in `mrbgems/mruby-compiler/core/codegen.c`.
2023-04-01 23:32:36 +09:00
dearblue
bcce4b7141
Need fixable_time_t_p() always
2023-04-01 23:22:08 +09:00
Yukihiro "Matz" Matsumoto
2de602b869
mruby-eval: add dependency to mruby-binding
2023-04-01 10:37:56 +09:00
Yukihiro "Matz" Matsumoto
eaaa474630
mruby-method/method.c: fix proc comparison for uncovered case
2023-04-01 10:37:16 +09:00
Yukihiro "Matz" Matsumoto
a3fc6ae53c
mruby-proc-ext/proc.c: use mrb_debug_get_position()
2023-04-01 10:37:15 +09:00
Yukihiro "Matz" Matsumoto
6629112291
Merge pull request #5957 from jbampton/clean-up-doc-limitations-md
...
doc/limitations.md: remove whitespace, add code block languages
2023-04-01 10:37:08 +09:00
John Bampton
e76525568a
doc/limitations.md: remove whitespace, add code block languages
2023-04-01 07:52:29 +10:00
Yukihiro "Matz" Matsumoto
58a83f3b9a
codeql-analysis.yml: stop running codeql workflow
2023-03-31 09:43:30 +09:00
Yukihiro "Matz" Matsumoto
85aefa8992
Merge pull request #5955 from LanzaSchneider/master
...
fix: wrong comment for ```mrb_debug_get_filename```
2023-03-31 08:27:27 +09:00
Yukihiro "Matz" Matsumoto
d482eabfa2
mruby-bigint/bigint.c: int.pow(n,m) to take bigint as exponential
2023-03-31 08:26:47 +09:00
Yukihiro "Matz" Matsumoto
62c52d5a28
mruby-bigint/bigint.c: remove unreachable line
2023-03-30 08:18:27 +09:00
Yukihiro "Matz" Matsumoto
35cedfb400
mruby-numeric-ext/numeric.c: Integer#pow fix for 2nd argument type
...
`int.pow()` takes 2nd argument only if 1st argument is an integer.
2023-03-30 08:18:27 +09:00
Lanza
01b03d852f
fix: wrong comment for ``mrb_debug_get_filename``
2023-03-30 06:57:33 +08:00
Yukihiro "Matz" Matsumoto
f1568af0d2
gc.c: fix GC regressions
...
The past fix was wrong.
2023-03-29 08:46:10 +09:00
Yukihiro "Matz" Matsumoto
1f5a4d5386
mruby-method/method.c (method_eql): simplify the logic
2023-03-27 19:21:40 +09:00
Yukihiro "Matz" Matsumoto
553f9ba802
mruby-method/method.c (method_eql): use mrb_proc_eql
2023-03-27 19:15:03 +09:00
Yukihiro "Matz" Matsumoto
fbb3a2426f
proc.c (mrb_proc_eql): define == and eql? for Proc class
2023-03-27 19:14:21 +09:00
Yukihiro "Matz" Matsumoto
ddb2240b5e
proc.c: update ISO section numbers for methods
2023-03-27 11:39:58 +09:00
Yukihiro "Matz" Matsumoto
b885d7387d
proc.c: no need to define Proc.lambda
...
Since Kernel is an ancestor of Kernel module itself recursively.
2023-03-27 11:33:13 +09:00
Yukihiro "Matz" Matsumoto
0f63551def
mruby-method/method.c (method_p): stricter method type check
2023-03-27 11:32:15 +09:00
Yukihiro "Matz" Matsumoto
f4cff664e6
mruby-proc-ext/proc.c: no need to define Kernel.proc
...
Since Kernel is an ancestor of Kernel module itself recursively.
2023-03-27 00:18:57 +09:00
Yukihiro "Matz" Matsumoto
3e7ced5d63
mruby-proc-ext/proc.c: remove prefix from static functions
2023-03-27 00:12:18 +09:00
Yukihiro "Matz" Matsumoto
0bbfec3e8b
mruby-eval: use functions from mruby-binding to simplify the code
2023-03-25 19:12:46 +09:00
Yukihiro "Matz" Matsumoto
11af5db1c3
mruby-binding: renamed from mruby-binding-core
...
The dependency is now:
mruby-binding-eval:
- mruby-binding
- mruby-eval
mruby-proc-binding:
- mruby-binding
mruby-eval:
- mruby-binding [new]
2023-03-24 12:25:57 +09:00
Yukihiro "Matz" Matsumoto
3ef41672ab
mruby-biding-eval: move essential part of the gem to mruby-eval
...
This change makes mruby-binding-eval gem nearly empty, but needed to
make `eval(str, binding)` works as well as `binding.eval(str)`.
2023-03-24 07:33:13 +09:00
Yukihiro "Matz" Matsumoto
910afdc691
mruby-binding-eval: modify struct initialization
2023-03-23 22:10:20 +09:00
Yukihiro "Matz" Matsumoto
5914d9e9d4
mruby-binding-eval: remove unused members from binding_eval_prepar_body
2023-03-23 16:16:52 +09:00
Yukihiro "Matz" Matsumoto
bf9a2501d1
mruby-binding-eval: move non raising code to the parent function
2023-03-22 23:22:45 +09:00
Yukihiro "Matz" Matsumoto
bdbc613ccb
parse.y (mrbc_filename): should not raise exceptions
2023-03-22 17:33:49 +09:00
Yukihiro "Matz" Matsumoto
feabcfe29e
doc/limitations.md: remove an entry regarding binding
...
Since it's no longer a limitation.
2023-03-22 15:26:29 +09:00
Yukihiro "Matz" Matsumoto
501b22a2ac
mruby-binding-eval: renamed from mruby-binding
...
Since this gem only provides `Binding#eval`.
2023-03-22 15:25:23 +09:00
Yukihiro "Matz" Matsumoto
979e8602dd
mruby-binding-core: make mrb_binding_wrap_lvspace static
2023-03-21 16:18:15 +09:00
Yukihiro "Matz" Matsumoto
66ca9722b6
mruby-binding-core (mrb_binding_new): new function
...
Use this function instead of `mrb_binding_alloc` (removed).
2023-03-21 16:17:08 +09:00
Yukihiro "Matz" Matsumoto
88ae5e8cf8
mruby-binding-core: use mrb_binding_wrap_lvspace if possible
2023-03-21 16:10:15 +09:00
Yukihiro "Matz" Matsumoto
495845443c
mruby-binding-core (mrb_binding_p) add new function
2023-03-21 16:10:15 +09:00
Yukihiro "Matz" Matsumoto
35e2779575
Small cosmetic changes (adjust indent, and remove extra space)
2023-03-21 16:10:15 +09:00
Yukihiro "Matz" Matsumoto
0c8404a3e2
mruby-binding: use C implementation of Kernel#eval directly
2023-03-21 16:10:15 +09:00
Yukihiro "Matz" Matsumoto
1c765dc37a
Merge pull request #5902 from dearblue/threadedcode
...
Replace `MRB_NO_DIRECT_THREADING` with `MRB_USE_VM_SWITCH_DISPATCH`
2023-03-18 23:56:04 +09:00
dearblue
f6c9191cd0
Replace MRB_NO_DIRECT_THREADING with MRB_USE_VM_SWITCH_DISPATCH
...
The correct technique now is "Token Threading".
However, the new name was chosen because it was felt that if a different technique was added in the future, there would be no need to replace it.
2023-03-18 17:39:41 +09:00
Yukihiro "Matz" Matsumoto
db11e07497
Merge pull request #5951 from dearblue/mrb_yield
...
Safely retrieve `self` from proc in `mrb_yield()`
2023-03-17 22:54:05 +09:00
dearblue
2675477f07
Safely retrieve self from proc in mrb_yield()
...
Passing a proc generated by the following method to `mrb_yield()` or `mrb_yield_argv()` no longer causes `SIGSEGV`:
- C functions made into proc objects with `mrb_proc_new_cfunc()`.
- A proc object which is the top level of a program generated by `mrb_load_string_cxt()` etc. with `mrbc_context::no_exec` enabled.
See also: #5932
2023-03-17 21:20:48 +09:00
Yukihiro "Matz" Matsumoto
800cb15fc3
limitation.md: describe mruby limitation for keyword arguments; #5952
2023-03-17 18:58:04 +09:00
Yukihiro "Matz" Matsumoto
de70014643
mruby-binding/binding.c: add comment for functions from outer gems
2023-03-16 19:02:23 +09:00
Yukihiro "Matz" Matsumoto
62a8ea7113
mruby-bigint/bigint.c: mrb_bint_add_d, mrb_bint_sub_d only take int
...
Where mrb_bint_add and mrb_bint_sub may take float numbers.
2023-03-15 19:09:02 +09:00
Yukihiro "Matz" Matsumoto
3f7ea47ec1
Merge pull request #5917 from jbampton/remove-super-linter-folder
...
Remove `super-linter.report` folder
2023-03-15 19:07:30 +09:00
Yukihiro "Matz" Matsumoto
4fc69ce3bc
Revert "mruby/throw.h: do not use __builtin_setjmp for GCC; close #5950 "
...
This reverts commit 9cf49d08b4 .
This change caused flaky tests on MinGW. I now remember it was introduced
for MINGW64 to address #5133 . Sorry.
2023-03-14 19:50:15 +09:00
Yukihiro "Matz" Matsumoto
0d07af104b
internal.h: move function prototypes to <mruby/internal.h>
2023-03-14 11:06:44 +09:00
Yukihiro "Matz" Matsumoto
2d975d59ce
Merge branch 'dearblue-binding.4'
2023-03-14 11:05:53 +09:00
Yukihiro "Matz" Matsumoto
6915e75207
Merge branch 'binding.4' of https://github.com/dearblue/mruby into dearblue-binding.4
2023-03-14 11:05:10 +09:00
Yukihiro "Matz" Matsumoto
da2cfa62f4
AUTHORS: update entries [ci skip]
2023-03-13 19:01:32 +09:00
Yukihiro "Matz" Matsumoto
0906cd7593
numeric.c: fix rounding function issues with big numbers
...
- int_ceil
- int_floor
- int_round
- int_truncate
2023-03-13 18:53:17 +09:00
Yukihiro "Matz" Matsumoto
8d1192f8a2
gc.c (mrb_field_write_barrier): change the condition
...
Minor GC may be suspended with the MRB_GC_STATE_SWEEP.
2023-03-13 18:52:03 +09:00
Yukihiro "Matz" Matsumoto
ccca6ec458
gc.c (clear_all_old): simplify the code
...
The function is called only with generational mode.
2023-03-13 18:50:51 +09:00
Yukihiro "Matz" Matsumoto
9a1e6760a8
mruby-bigint: add new functions mrb_bint_add_d, mrb_bint_sub_d
...
Those functions do not normalize the return value to avoid repeated
conversions between Bigints and (small) Integers.
2023-03-13 16:07:17 +09:00
Yukihiro "Matz" Matsumoto
f7cbb319cb
mruby-bigint: remove unused mrb_bint_div_ii() function
2023-03-13 08:10:41 +09:00
Yukihiro "Matz" Matsumoto
33320b08bb
mruby-data: fix uninitialized variable error
2023-03-13 08:09:26 +09:00
Yukihiro "Matz" Matsumoto
7327ca898c
mruby-struct: fix uninitialized variable error
2023-03-13 08:08:30 +09:00
Yukihiro "Matz" Matsumoto
dd0a9e8970
mruby-bigint/bigint.c: remove a condition to stop warnings
2023-03-13 08:06:41 +09:00
Yukihiro "Matz" Matsumoto
9cf49d08b4
mruby/throw.h: do not use __builtin_setjmp for GCC; close #5950
...
https://gcc.gnu.org/onlinedocs/gcc/Nonlocal-Gotos.html
2023-03-13 08:05:55 +09:00
Yukihiro "Matz" Matsumoto
924d605712
vm.c: remove redundant assignment (already done in cipush)
2023-03-13 08:05:55 +09:00
Yukihiro "Matz" Matsumoto
0edb616f51
gc.c: remove time profiling code for debugging
2023-03-13 08:05:54 +09:00
Yukihiro "Matz" Matsumoto
a8d840da19
Merge pull request #5928 from dearblue/task/install
...
Improved `rake install`
2023-03-13 08:05:20 +09:00
Yukihiro "Matz" Matsumoto
938ad70e1e
Merge pull request #5938 from dearblue/reorganize-gem-init-final
...
Reorganize gem init final
2023-03-13 07:52:20 +09:00
dearblue
1432baec1d
Perform chores with mrb_final_mrbgems() function
...
The main purpose is to ignore exceptions raised by the GEMS finalizer.
2023-03-12 14:31:10 +09:00
dearblue
c474ae8cc4
Perform chores with mrb_init_mrbgems() function
...
Make the `mrb_init_mrbgems()` function do the cleanup and error handling.
Instead, simplify processing in the `GENERATED_TMP_mrb_XXX_gem_init()` function.
Previously, `mrb_load_irep()` or `mrb_load_proc()` would kill the process when an exception occurred.
With this patch, it is now caught by `mrb_core_init_protect()`.
2023-03-12 10:25:54 +09:00
Yukihiro "Matz" Matsumoto
629d81f57b
Merge pull request #5937 from dearblue/note-gem-init
...
Add the generator path to the `build/***/gem_init.c` file
2023-03-12 08:01:38 +09:00
Yukihiro "Matz" Matsumoto
894ce40797
Merge pull request #5946 from dearblue/const-search
...
Don't switch constant search path from modules to Object
2023-03-11 16:19:53 +09:00
Yukihiro "Matz" Matsumoto
90e53cad39
Merge pull request #5945 from dearblue/env-internal
...
Avoid exposure for `REnv` objects
2023-03-11 16:18:28 +09:00
Yukihiro "Matz" Matsumoto
7f79ca2cf6
mruby-compiler: need to adjust the line number for do_block; fix #5949
2023-03-11 15:49:35 +09:00
Yukihiro "Matz" Matsumoto
927a9df453
mruby-data/data.c: allow empty Data
2023-03-10 08:52:06 +09:00
Yukihiro "Matz" Matsumoto
c212edec5f
mruby-struct/struct.c: allow empty Struct when a name is not given
2023-03-10 08:52:06 +09:00
Yukihiro "Matz" Matsumoto
fc4fe48a00
mruby-time/time.c: fix error message from localtime_r(3) failure
2023-03-10 08:52:06 +09:00
Yukihiro "Matz" Matsumoto
13cd0e5585
mruby-time/time.c (mrb_time_minus): specify mrb_float directly
...
The `typedef mrb_sec` does not improve readability at all.
2023-03-10 08:52:06 +09:00
Yukihiro "Matz" Matsumoto
e62d672ef3
mruby-time/time.c (mrb_to_time_t): support Bigint if defined
2023-03-10 08:52:06 +09:00
Yukihiro "Matz" Matsumoto
01233f70bd
mruby-bigint/bigint.c: add two new functions to convert to 64bit int
...
- mrb_bint_as_int64()
- mrb_bint_as_uint64()
2023-03-10 08:52:05 +09:00
Yukihiro "Matz" Matsumoto
c71408bc0a
mruby-time/time.c (mrb_to_time_t): raise error if obj is not time
...
Or a time-compatible object like a number.
2023-03-10 08:52:05 +09:00
Yukihiro "Matz" Matsumoto
7096d277da
mruby-time/time.c: support bigint to time_t if necessary
2023-03-10 08:52:05 +09:00
Yukihiro "Matz" Matsumoto
da8c23524f
mruby-time/time.c (mrb_to_time_t): use floor instead of llround
...
Since we should generate `t=(sec+usec)` from a floating point number
`sec` should be `floor(f)` especially for negative numbers, if the place
for `usec` is specified. In contrast, we can `round` the below point
digits if we are going to ignore them. But we now use `round` instead of
`llround` which directly convert `double` to `long long`, to add
boundary check for conversion.
2023-03-10 08:52:05 +09:00
Yukihiro "Matz" Matsumoto
2f0265d078
mruby-io/io.c (check_file_descriptor): stop "unused label" warning
2023-03-10 08:52:05 +09:00
Yukihiro "Matz" Matsumoto
9a3199cadd
mruby-io/file.c: atime, ctime, mtime to return Bigint if possible
2023-03-10 08:52:05 +09:00
Yukihiro "Matz" Matsumoto
a3b84fbb08
mruby-bigint/bigint.c: add 2 new functions for 64 bit integer
...
- mrb_bint_new_int64()
- mrb_bint_new_uint64()
2023-03-10 08:52:05 +09:00
Yukihiro "Matz" Matsumoto
b1d0a3d3aa
etc.c (mrb_float_id): define the function only when necessary
2023-03-10 08:52:04 +09:00
Yukihiro "Matz" Matsumoto
e5de08b692
mruby-time/time.c (time_mktime): should allow year before 1900
...
If the platform use 64 bit time_t, it is possible to represent the year
before 1903. So we should remove this check.
2023-03-10 08:52:04 +09:00
Yukihiro "Matz" Matsumoto
bcd595ad1b
mruby-bigint/bigint.c: add else to skip if check
2023-03-10 08:52:04 +09:00
Yukihiro "Matz" Matsumoto
f1ffedc3fa
vm.c: kdict may be converted to a normal argument; fix #5944
2023-03-10 08:52:04 +09:00
Yukihiro "Matz" Matsumoto
18158c96f5
Merge pull request #5948 from dearblue/cinfo
...
Added note to `CINFO_*` constants
2023-03-10 08:50:26 +09:00
Yukihiro "Matz" Matsumoto
840953b55a
Merge pull request #5947 from dearblue/fiber-resume
...
Remove unreachable codes in `Fiber#resume`
2023-03-10 08:49:12 +09:00
dearblue
ddaf3bdc0f
Added note to CINFO_* constants
2023-03-09 22:13:52 +09:00
dearblue
f4c4809750
Remove unreachable codes in Fiber#resume
...
ref. #5782
2023-03-09 21:40:03 +09:00
dearblue
9c9be44a98
Don't switch constant search path from modules to Object
...
Previously, for example, it was possible to retrieve the `String` class as follows:
```console
% bin/mruby -e 'p Comparable::Enumerable::Errno::GC::Kernel::Math::ObjectSpace::String'
String
```
Note that this patch affects the API function `mrb_const_get()`.
2023-03-05 20:32:56 +09:00
dearblue
38d5ed44e1
Avoid exposure for REnv objects
...
The `REnv` object is difficult to deal with, and it would be ideal if the user did not have to manipulate it directly.
In some previous situations, it was necessary to call `mrb_env_unshare()`, a non-API function, after `mrb_load_string()` or similar.
With this patch, it is no longer necessary for users to use `mrb_env_unshare()` directly, as it is now handled internally simply by using the `mrb_vm_ci_env_clear()` function.
Also, `mrb_vm_ci_env_set()` is demoted from the `MRB_API` function for the same reason.
ref. commit 1ab3da6f08
2023-03-05 17:45:47 +09:00
Yukihiro "Matz" Matsumoto
45ee9cc404
mruby-socket/socket.c: read/write should be redefined on Windows; fix #5943
...
Since normal file descriptors and sockets cannot be mixed on the
platform.
2023-03-04 09:27:43 +09:00
Yukihiro "Matz" Matsumoto
42d3efee1c
mruby-socket/socket.c: read/write should be redefined on Windows; fix #5943
...
Since normal file descriptors and sockets cannot be mixed on the
platform.
2023-03-03 15:30:51 +09:00
Yukihiro "Matz" Matsumoto
011edf6e99
mruby-io/file.c: hide internal methods in backtraces
2023-03-03 14:23:10 +09:00
Yukihiro "Matz" Matsumoto
5237b2cccc
mruby-io/file.c: atime, ctime, mtime check mrb_int overflow
...
When `sizeof(time_t)` is different from `mrb_int`, overflow may happen.
2023-03-03 14:21:05 +09:00
Yukihiro "Matz" Matsumoto
0e51da81bb
mruby-io/file.rb (inspect): include path in the #inspect output
2023-03-03 13:33:30 +09:00
Yukihiro "Matz" Matsumoto
a956ef35a4
mruby-io/file.c: atime, ctime, mtime should raise error
...
For fstat(3) failure.
2023-03-03 13:33:29 +09:00
Yukihiro "Matz" Matsumoto
9c6848a594
mruby-io/io.c (check_file_descriptor): only check EBADF
2023-03-03 13:33:29 +09:00
Yukihiro "Matz" Matsumoto
0529f5fc31
mruby-io/test/file.rb: add tests for File#atime, File#ctime
2023-03-03 13:33:29 +09:00
Yukihiro "Matz" Matsumoto
321cfe9760
mruby-io/file.c: add File#atime and File#ctime
2023-03-03 13:33:29 +09:00
Yukihiro "Matz" Matsumoto
31c1b7bc78
mruby-file: File#mtime has been available for long time
2023-03-03 13:33:29 +09:00
Yukihiro "Matz" Matsumoto
84a4d340a6
mruby-io/file.c (_mtime): return nil instead of false
...
As a Ruby convention, a method should return nil (not false) for the
exceptional value, e.g. String#index. File#_mtime should follow the
convention too.
2023-03-03 13:33:29 +09:00
Yukihiro "Matz" Matsumoto
d86c4a795d
mruby-io does not provide to_path method for implicit conversion
...
mruby does not use implicit type conversion by `to_xxx` (e.g. to_int,
to_str, etc.)
2023-03-03 13:33:29 +09:00
Yukihiro "Matz" Matsumoto
d7f4af04ca
Merge pull request #5939 from jbampton/appveyor-add-visual-studio-2022
...
appveyor: add job for Visual Studio 2022
2023-03-02 15:08:50 +09:00
Yukihiro "Matz" Matsumoto
bdf39fe4af
Merge pull request #5940 from jbampton/remove-misspell
...
Remove `misspell` and update `CONTRIBUTING.md`
2023-03-01 23:47:41 +09:00
Yukihiro "Matz" Matsumoto
0d35fe072e
Merge pull request #5941 from jbampton/simplify-the-editorconfig-file
2023-03-01 23:42:08 +09:00
John Bampton
a874b80dae
Simplify the .editorconfig file
...
We already have `trailing-whitespace` set globally in the `pre-commit` config
and we are also using `spaces` instead of `tabs` except for "Makefiles" which have `tab_width = 8`
Perhaps in future we can enforce line lengths.
https://github.com/mruby/mruby/blob/92ca93c885a6e6d2facd8e9ca3dbf85ac3dce8c9/.pre-commit-config.yaml#L29
https://github.com/mruby/mruby/blob/92ca93c885a6e6d2facd8e9ca3dbf85ac3dce8c9/.pre-commit-config.yaml#L33
2023-03-01 21:34:23 +10:00
John Bampton
2559c93b2b
Remove misspell and update CONTRIBUTING.md
...
It looks like `misspell` is no longer maintained and
the last commit was on `Mar 9, 2018`.
We already run `codespell` and it is an active project
with the last commit 5 days ago.
Also updated the CONTRIBUTING guide with more
information on `pre-commit` as well as listed `codespell`
as the spell checker.
https://github.com/codespell-project/codespell
https://github.com/client9/misspell
https://github.com/client9/misspell/issues/197
2023-03-01 17:49:39 +10:00
John Bampton
47dcb393ca
appveyor: add job for Visual Studio 2022
...
Visual Studio 2022 on Windows is now a 64-bit application.
https://www.appveyor.com/docs/build-environment/#build-worker-images
https://learn.microsoft.com/en-us/visualstudio/ide/whats-new-visual-studio-2022?view=vs-2022#visual-studio-2022-is-64-bit
2023-03-01 03:21:46 +10:00
dearblue
396ca2809f
Add the generator path to the build/***/gem_init.c file
2023-02-28 22:11:14 +09:00
Yukihiro "Matz" Matsumoto
92ca93c885
Merge pull request #5936 from jbampton/remove-duplicate-method-calls
...
benchmark: remove duplicate method calls
2023-02-25 22:10:28 +09:00
Yukihiro "Matz" Matsumoto
b59832ed26
Merge pull request #5935 from jbampton/upgrade-doxyfile
...
Upgrade the `Doxyfile`
2023-02-25 22:09:36 +09:00
John Bampton
d86f4d220f
benchmark: remove duplicate method calls
...
DuplicateMethodCall: Scene#render calls 'nsf * nsf' 3 times
2023-02-25 15:22:49 +10:00
John Bampton
5dd0f74ecf
Upgrade the Doxyfile
...
```
mruby % doxygen -u
warning: Tag 'CLANG_ASSISTED_PARSING' at line 50 of file 'Doxyfile' belongs to an option that was not enabled at compile time.
This tag has been removed.
warning: Tag 'CLANG_OPTIONS' at line 51 of file 'Doxyfile' belongs to an option that was not enabled at compile time.
This tag has been removed.
warning: Tag 'TCL_SUBST' at line 238 of file 'Doxyfile' has become obsolete.
This tag has been removed.
warning: Tag 'COLS_IN_ALPHA_INDEX' at line 1075 of file 'Doxyfile' has become obsolete.
This tag has been removed.
warning: Tag 'FORMULA_TRANSPARENT' at line 1481 of file 'Doxyfile' has become obsolete.
This tag has been removed.
warning: Tag 'LATEX_SOURCE_CODE' at line 1769 of file 'Doxyfile' has become obsolete.
This tag has been removed.
warning: Tag 'RTF_SOURCE_CODE' at line 1851 of file 'Doxyfile' has become obsolete.
This tag has been removed.
warning: Tag 'DOCBOOK_PROGRAMLISTING' at line 1949 of file 'Doxyfile' has become obsolete.
This tag has been removed.
warning: Tag 'PERL_PATH' at line 2094 of file 'Doxyfile' has become obsolete.
This tag has been removed.
warning: Tag 'CLASS_DIAGRAMS' at line 2107 of file 'Doxyfile' has become obsolete.
This tag has been removed.
warning: Tag 'MSCGEN_PATH' at line 2116 of file 'Doxyfile' has become obsolete.
This tag has been removed.
warning: Tag 'DOT_FONTNAME' at line 2158 of file 'Doxyfile' has become obsolete.
This tag has been removed.
warning: Tag 'DOT_FONTSIZE' at line 2165 of file 'Doxyfile' has become obsolete.
This tag has been removed.
warning: Tag 'DOT_TRANSPARENT' at line 2391 of file 'Doxyfile' has become obsolete.
This tag has been removed.
Configuration file 'Doxyfile' updated.
```
2023-02-25 12:55:53 +10:00
Yukihiro "Matz" Matsumoto
ee599b25c1
Merge pull request #5934 from jbampton/rake-checkupdate
...
Run `rake checkupdate`
2023-02-25 09:26:26 +09:00
Yukihiro "Matz" Matsumoto
f8a66c88b8
Merge pull request #5933 from jbampton/update-mruby-version-numbers
...
docs: update mruby version to `3.2.0`
2023-02-25 09:26:03 +09:00
John Bampton
d4dd75b82c
Run rake checkupdate
...
`pre-commit autoupdate`
2023-02-25 08:12:50 +10:00
John Bampton
46e42b38f0
docs: update mruby version to 3.2.0
2023-02-25 08:02:45 +10:00
Yukihiro "Matz" Matsumoto
82c67d52fc
Merge pull request #5931 from mruby/stable
...
Merge mruby 3.2.0
2023-02-24 23:19:09 +09:00
mimaki
87260e7bb1
Update version and release date. (mruby 3.2.0 (2023-02-24))
2023-02-24 19:51:12 +09:00
Yukihiro "Matz" Matsumoto
1ab3da6f08
vm.c (ci_env_set): inline ci_env_set()
...
Along with making preparing mrb_vm_ci_env_clar() as a replacement of
mrb_vm_ci_env_set(mrb, NULL).
2023-02-23 17:16:10 +09:00
Yukihiro "Matz" Matsumoto
2c046eb512
mruby.h: replace frequently used inline functions with macros
...
- mrb_gc_arena_save()
- mrb_gc_arena_restore()
2023-02-22 16:35:14 +09:00
Yukihiro "Matz" Matsumoto
d8d1fe27f6
vm.c (stack_extend): inline mrb_stack_extend() in vm.c
2023-02-22 12:05:46 +09:00
Yukihiro "Matz" Matsumoto
43922a5bf9
vm.c (mrb_gc_arena_shrink): use local variable
2023-02-21 21:59:42 +09:00
Yukihiro "Matz" Matsumoto
a21edf75ad
Use mrb_get_arg1() instead of mrb_get_args() for single argument
2023-02-21 16:33:15 +09:00
Yukihiro "Matz" Matsumoto
aecbdf72bf
vm.c (mrb_env_unshare): remove unnecessary mrb_write_barrier() call
...
Since this function does not modify references from env, we don't need
to put write barrier here.
2023-02-21 09:45:17 +09:00
Yukihiro "Matz" Matsumoto
d4cb136deb
kernel.c (mrb_obj_ceqq): skip unnecessary mrb_ary_entry()
...
We have checked the boundary before the call.
2023-02-20 17:33:52 +09:00
Yukihiro "Matz" Matsumoto
76157c5f78
add inline specifier to frequently called functions
...
- entry_deleted_p(): hash.c
- ensure_block(): vm.c
2023-02-19 19:06:37 +09:00
Yukihiro "Matz" Matsumoto
7cbe6894b4
debug.c (mrb_debug_get_position): avoid duplicate calls to get_file()
2023-02-19 19:05:54 +09:00
Yukihiro "Matz" Matsumoto
78137f31c8
error.c (mrb_make_exception): reinvent exception creation
...
The arguments of mrb_make_exception() has changed. I believe no one is
using the function, but beware.
2023-02-18 11:51:33 +09:00
Yukihiro "Matz" Matsumoto
431f83eb8c
error.c (mrb_make_exception): make the function internal
2023-02-17 17:04:09 +09:00
Yukihiro "Matz" Matsumoto
515b2fd144
class.c (mrb_method_added): skip mrb_funcall_id() is possible
...
When `method_added` is not redefined, we don't need to call it since its
default implementation does nothing.
2023-02-16 09:38:26 +09:00
Yukihiro "Matz" Matsumoto
2768fd62a0
Reduce calls to mrb_obj_is_kind_of()
2023-02-15 11:45:10 +09:00
Yukihiro "Matz" Matsumoto
235aaafef2
array.c (mrb_ary_aset): remove unnecessary ary_modify()
...
The `ary_modify()` is called in subsidiary functions.
2023-02-14 23:45:10 +09:00
Yukihiro "Matz" Matsumoto
4384a87516
class.c, vm.c: use loop variable declaration in for statement
2023-02-13 14:16:53 +09:00
Yukihiro "Matz" Matsumoto
58aefd6010
class.c, vm.c: use NULL instead of 0 for pointers
2023-02-13 14:16:30 +09:00
Yukihiro "Matz" Matsumoto
ea0e8f7ea4
numeric.c (flo_mod): use NULL instead of 0
...
In C, we don't use 0 as NULL representation.
2023-02-13 00:08:40 +09:00
dearblue
7c7ed3c27a
Write symbolik links or batch files in INSTALL_DIR
...
Since `bin/mruby-config` now points to a directory relative to itself, it is no longer possible to reach `include/` or `lib/`.
Therefore, avoid placing entities in them.
2023-02-12 23:25:05 +09:00
dearblue
11513bae43
Make bin/mruby-config output a directory based on itself
2023-02-12 23:25:01 +09:00
dearblue
3d996a84cc
Takes the environment variable DESTDIR in rake install
...
If the environment variable `DESTDIR` is set, the writing destination is `<DESTDIR>/<PREFIX>/...`.
It is assumed to be used for package work.
2023-02-12 21:02:31 +09:00
dearblue
0e9a71e50a
Install other build targets with rake install:full
...
Build targets other than "host" will be installed under `<PREFIX>/mruby/<build-name>`.
This can be changed with `build.install_prefix = dir`.
2023-02-12 21:02:30 +09:00
dearblue
7fd7409bf2
Files copied by task install should be from the build directory
2023-02-12 21:02:29 +09:00
dearblue
aac2fd7055
Copy header files to the build directory
...
This is so that the build directory can be regarded as a temporary installation directory to work in.
Directories set in `MRuby::Gem::Specification#export_include_paths` are used as they are if they are subdirectories placed under `gem.dir`.
Files are placed under `<build-dir>/include/mruby/gems/<gem-name>/<gem-include_paths>` to separate each GEM.
When GEM is compiled by building `libmruby.a`, the same `include_paths` will be set as before, so it is expected that no unintended references will be made.
2023-02-12 21:02:28 +09:00
dearblue
c020d8507e
Separate rake install related stuff into tasks/install.rake
2023-02-12 21:02:27 +09:00
Yukihiro "Matz" Matsumoto
4f9caea891
range.c (range_num_to_a): add array entries directly
...
Calling `mrb_ary_push()` is slower.
2023-02-11 16:13:33 +09:00
Yukihiro "Matz" Matsumoto
2adb1043f4
array.c (mrb_ary_push_m): call mrb_ary_push() when argc == 1
2023-02-11 14:23:48 +09:00
Yukihiro "Matz" Matsumoto
b4c936b533
use new E_EXCEPTION and E_STANDARD_ERROR; ref #5924
2023-02-10 15:21:38 +09:00
Yukihiro "Matz" Matsumoto
49709a65c7
AUTHORS: update entries [ci skip]
2023-02-10 15:21:38 +09:00
Yukihiro "Matz" Matsumoto
bed7a79add
Merge pull request #5927 from jbampton/remove-unneeded-whitespace
...
md/yml: remove unneeded blank lines and whitespace
2023-02-10 14:24:47 +09:00
Yukihiro "Matz" Matsumoto
7373b63919
Merge pull request #5926 from jbampton/update-license-year
...
Update License year to 2023
2023-02-10 14:23:32 +09:00
John Bampton
07a7d2a6cb
md/yml: remove unneeded blank lines and whitespace
2023-02-10 14:02:57 +10:00
John Bampton
8af0aa4905
Update License year to 2023
2023-02-10 11:55:32 +10:00
mimaki
4ca2129889
Update version to 3.2.0RC4.
2023-02-08 10:04:29 +09:00
Yukihiro "Matz" Matsumoto
fc53cd20b6
Merge pull request #5925 from jbampton/update-authors-file
...
AUTHORS: update "as of" info for `year`
2023-02-08 06:38:31 +09:00
Yukihiro "Matz" Matsumoto
75bdb4e0ec
Merge pull request #5924 from dearblue/exception-classes
...
Improve consistency of how error classes are retrieved
2023-02-08 06:30:34 +09:00
Yukihiro "Matz" Matsumoto
8a2bb9eb93
Merge pull request #5923 from dearblue/mrb_f_raise
...
Demotion `mrb_f_raise()` from `MRB_API`
2023-02-08 06:30:17 +09:00
John Bampton
5189d73d6d
AUTHORS: update "as of" info for year
...
The AUTHORS file was last published on January 8th 2023
2023-02-08 03:29:10 +10:00
dearblue
a93807f48f
Improve consistency of how error classes are retrieved
2023-02-07 22:46:56 +09:00
dearblue
0898ce982e
Demotion mrb_f_raise() from MRB_API
...
This function is the entity of the `Kernel.#raise` or `Kernel#fail` method.
I don't think users can use it whenever they want, and I don't think there is any need to expose it as an entity of a user-defined method.
2023-02-07 22:37:58 +09:00
Yukihiro "Matz" Matsumoto
056cda72be
mruby-bin-mirb: fix multi-line input issue; fix #5922
...
Bison changed the message for the end-of-file error. `mirb` should
be updated for the new message.
2023-02-07 17:43:14 +09:00
Yukihiro "Matz" Matsumoto
762ca43c16
mruby-bin-mirb: add bintest for multi-line input; ref #5922
2023-02-07 17:42:56 +09:00
Yukihiro "Matz" Matsumoto
78141d17f1
mruby-bin-mirb: fix multi-line input issue; fix #5922
...
Bison changed the message for the end-of-file error. `mirb` should
be updated for the new message.
2023-02-07 15:45:11 +09:00
Yukihiro "Matz" Matsumoto
a25755060c
mruby-bin-mirb: add bintest for multi-line input; ref #5922
2023-02-07 15:44:50 +09:00
Yukihiro "Matz" Matsumoto
6ca1b8e4e7
mruby-catch/catch.c: update disasm comment for new output format
2023-02-06 11:21:52 +09:00
Yukihiro "Matz" Matsumoto
7e607c67f2
codedump.c: adjust output format for ireps and literals
...
- I(%d:%p) -> I[%d]
- L(%d) -> L[%d]
The irep address is not useful, so just print index in reps table.
And use `[]` instead of `()` to clarify they are index.
2023-02-06 11:13:48 +09:00
Yukihiro "Matz" Matsumoto
1e122f7887
mruby-catch/catch.c: add disassembled comment for catch irep
2023-02-05 22:53:11 +09:00
Yukihiro "Matz" Matsumoto
acecee0da1
mruby-print/print.c: rename __printstr__ to __printstr
...
As a convention other internal methods are prefixed by `__`.
2023-02-04 18:58:07 +09:00
Yukihiro "Matz" Matsumoto
1273c04e26
mruby-print/print.rb: update ISO references
2023-02-04 18:57:43 +09:00
Yukihiro "Matz" Matsumoto
8c8bbd94dc
error.c: add new error handling API functions; ref #2837
...
- mrb_clear_error(): clear error status of mrb_state
- mrb_check_error(): check if error caused in the previous API
Note that `mrb_check_error` clears error status, so if you call
`mrb_check_error` more than once, latter calls will return FALSE.
2023-02-03 14:28:24 +09:00
Yukihiro "Matz" Matsumoto
f5a7b6aad2
hash.rb: defer local variable initialization
2023-02-02 22:45:30 +09:00
Yukihiro "Matz" Matsumoto
1b299addaf
mruby-hash-ext/hash.rb: implement Hash#compact! in C
...
Using `__compact` method defined in the core, since hash access
functions are private to `src/hash.c`.
2023-02-02 22:44:04 +09:00
Yukihiro "Matz" Matsumoto
9cda737a56
mruby-hash-ext/test: test Hash#compact! returns nil if unmodified
2023-02-02 22:42:36 +09:00
Yukihiro "Matz" Matsumoto
0a1fd07910
mruby-time/time.c: implement weekday methods in C
2023-02-01 14:33:46 +09:00
Yukihiro "Matz" Matsumoto
ecd2d8c11e
wrap method arguments by parentheses as convention
2023-02-01 14:33:46 +09:00
Yukihiro "Matz" Matsumoto
caac15e8e1
Merge pull request #5919 from jbampton/make-rake-add-target
...
Makefile/Rakefile add target/task for `pre-commit install`
2023-02-01 14:29:40 +09:00
Yukihiro "Matz" Matsumoto
2dcc7346b4
Merge pull request #5918 from jbampton/actions-checkout-name-info
...
gha: full details for `actions/checkout` name
2023-02-01 14:28:40 +09:00
John Bampton
2bb6eeb7c0
Makefile/Rakefile add target/task for pre-commit install
2023-02-01 13:14:23 +10:00
John Bampton
5532d176e1
gha: full details for actions/checkout name
2023-02-01 02:00:56 +10:00
John Bampton
7d4200df84
Remove super-linter.report folder
...
The `super-linter.report` folder does not seem to be listed anymore on https://github.com/github/super-linter
2023-01-31 22:46:39 +10:00
Yukihiro "Matz" Matsumoto
d41ea96c2a
string.c: fix boundary check in String#bytesplice
...
It should be able to append to the receiver.
2023-01-29 17:10:15 +09:00
Yukihiro "Matz" Matsumoto
a2e2e83012
string.c: move String#bytesplice to the core
2023-01-28 16:43:40 +09:00
Yukihiro "Matz" Matsumoto
12e232c006
mruby-string-ext/string.rb: add test for String#bytesplice
2023-01-28 16:41:40 +09:00
Yukihiro "Matz" Matsumoto
52746479a3
mruby-string-ext/string.c: new method String#byteslice
2023-01-27 23:22:02 +09:00
Yukihiro "Matz" Matsumoto
7b27346386
mruby-os-memsize/memsize.c: avoid mrb_get_args()
2023-01-26 11:14:10 +09:00
Yukihiro "Matz" Matsumoto
78bbf75981
mruby-random/random.c: avoid mrb_get_args()
2023-01-26 11:13:48 +09:00
Yukihiro "Matz" Matsumoto
4e85e855cf
numeric.c: avoid mrb_get_args() if possible
2023-01-25 14:10:43 +09:00
Yukihiro "Matz" Matsumoto
4e5be5a288
array.c: avoid slower mrb_get_args() if possible
2023-01-25 14:10:03 +09:00
Yukihiro "Matz" Matsumoto
37da677cc8
numeric.c (mrb_int_pow): avoid unnecessary calls to mrb_get_args()
2023-01-24 15:25:06 +09:00
Yukihiro "Matz" Matsumoto
d1449c2622
array.c (mrb_ary_times): avoid multiple calls to mrb_get_args()
2023-01-24 15:23:30 +09:00
Yukihiro "Matz" Matsumoto
d9bf3235d2
mruby-math/math.c: avoid mrb_get_args() if possible
...
When a method takes single argument, we can use lighter `mrb_get_arg1()`
instead of `mrb_get_args()`.
2023-01-24 09:15:20 +09:00
mimaki
6b82843e72
Update version to 3.2.0RC3.
2023-01-23 10:16:15 +09:00
mimaki
b40ab7bfee
Merge branch 'master' into stable
2023-01-23 09:54:02 +09:00
Yukihiro "Matz" Matsumoto
aefc5befbd
mruby-io/io.c: fix issues with gets; fix #5913
...
- gets with RS multiple times
- gets with RS with limit
- gets with limit bigger than buffer size
2023-01-23 07:30:40 +09:00
Yukihiro "Matz" Matsumoto
be5266fbe6
mruby-io/test: test gets with RS multiple times; ref #5913
2023-01-23 07:26:40 +09:00
Yukihiro "Matz" Matsumoto
4d5aadfc84
class.c (create_method_value): refactor mrb_method_t creation
2023-01-23 00:17:32 +09:00
Yukihiro "Matz" Matsumoto
079244c36a
src/class.c: add new function mrb_vm_find_method
...
The function skips `cp` dereference, and improve performance of method
calls slightly.
2023-01-23 00:17:32 +09:00
Yukihiro "Matz" Matsumoto
6b0efd43da
NEWS: copy entries from doc/mruby3.2.md
2023-01-23 00:17:32 +09:00
Yukihiro "Matz" Matsumoto
2e9f62b12c
Merge pull request #5914 from dearblue/doc/mruby3.2.md
...
Update mruby3.2.md for changes behavior of `mrb_vm_run()`
2023-01-22 22:49:57 +09:00
Yukihiro "Matz" Matsumoto
3c02c517ca
Merge pull request #5915 from dearblue/doc/mruby3.2.md.1
...
Update mruby3.2.md for new `mruby-data` gem
2023-01-22 22:49:05 +09:00
dearblue
998ef1711a
Update mruby3.2.md for new mruby-data gem
2023-01-22 20:52:09 +09:00
dearblue
a223778ee8
Update mruby3.2.md for changes behavior of mrb_vm_run()
2023-01-22 20:45:57 +09:00
Yukihiro "Matz" Matsumoto
882bb0662a
Merge pull request #5912 from dearblue/io-popen
...
Replaced `NO_IO_POPEN` with `MRB_NO_IO_POPEN`
2023-01-22 13:37:39 +09:00
dearblue
b0e537c05c
Replaced NO_IO_POPEN with MRB_NO_IO_POPEN
...
ref. commit 9deb52c7b2
2023-01-22 09:20:10 +09:00
Yukihiro "Matz" Matsumoto
97fe582d41
Merge pull request #5911 from dearblue/eval+binding
...
Fixed `Kernel#.eval` crash when given a custom defined `Binding` instance
2023-01-20 22:44:28 +09:00
dearblue
36f822d9af
Fixed Kernel#.eval crash when given a custom defined Binding instance
...
```console
% bin/mruby -e 'class Binding; end; eval "1", Binding.new'
zsh: segmentation fault (core dumped) bin/mruby -e 'class Binding; end; eval "1", Binding.new'
```
2023-01-20 21:26:21 +09:00
mimaki
b4f36b1ad9
Merge branch 'master' into stable
2023-01-18 10:45:35 +09:00
Yukihiro "Matz" Matsumoto
3a7e138c05
mruby/internal.h: add mrb_env_new to the internal function header
2023-01-18 10:37:48 +09:00
Yukihiro "Matz" Matsumoto
e6cf932d38
fixup! mruby/internal.h: add codedump functions to the internal function header
2023-01-18 10:37:48 +09:00
Yukihiro "Matz" Matsumoto
55eea005c8
mruby/internal.h: add codedump functions to the internal function header
...
ref #5906
2023-01-18 10:37:48 +09:00
mimaki
23aa5f91bc
Update version to 3.2.0RC2.
2023-01-18 10:26:58 +09:00
mimaki
830f88c5a0
Merge commit '9deb52c7b2ba6028d996172bfdd6cf8a0405ce1c' into stable
2023-01-18 09:45:23 +09:00
Yukihiro "Matz" Matsumoto
3639feb047
Merge pull request #5908 from dearblue/env-unshare.2
...
Make `mrb_env_unshare()` call in `mrb_vm_run()`
2023-01-18 08:05:00 +09:00
Yukihiro "Matz" Matsumoto
63597cbbd1
Merge pull request #5910 from mruby/dependabot/github_actions/github/super-linter-4.10.1
...
build(deps): bump github/super-linter from 4.10.0 to 4.10.1
2023-01-18 07:53:11 +09:00
Yukihiro "Matz" Matsumoto
faa6a5cb4f
Merge pull request #5906 from AlexDenisov/codedump-to-file
...
Add ability to dump bytecode into an arbitrary file
2023-01-18 07:37:12 +09:00
AlexDenisov
e15288e460
Add ability to dump bytecode into an arbitrary file
2023-01-17 19:01:55 +01:00
dependabot[bot]
823b8e4148
build(deps): bump github/super-linter from 4.10.0 to 4.10.1
...
Bumps [github/super-linter](https://github.com/github/super-linter ) from 4.10.0 to 4.10.1.
- [Release notes](https://github.com/github/super-linter/releases )
- [Changelog](https://github.com/github/super-linter/blob/main/docs/release-process.md )
- [Commits](https://github.com/github/super-linter/compare/v4.10.0...v4.10.1 )
---
updated-dependencies:
- dependency-name: github/super-linter
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com >
2023-01-17 14:01:22 +00:00
Yukihiro "Matz" Matsumoto
9deb52c7b2
mruby-io/io.c: allow disabling popen
...
When `MRB_NO_IO_POPEN` is defined (or iPhone is target), `IO#popen`
will be disabled.
2023-01-17 18:25:23 +09:00
Yukihiro "Matz" Matsumoto
6b87aae757
doc/guides/compile.md: update compilation example
...
Show usage of multiple command-line options to `mruby-config`.
2023-01-17 18:23:29 +09:00
Yukihiro "Matz" Matsumoto
10768c1191
LEGAL: add entries for non-MIT licensed files.
2023-01-17 18:23:29 +09:00
Yukihiro "Matz" Matsumoto
2c261503b5
doc/internal/boxing.md: remove an extra double quote sign.
2023-01-16 19:01:11 +09:00
Yukihiro "Matz" Matsumoto
7a6d03f869
vm.c: transferred fiber termination should kick root fiber; fix #5907
2023-01-16 18:25:50 +09:00
Yukihiro "Matz" Matsumoto
3f6fd994f0
README.md: mruby is not Ruby 3.x compatible (for syntax at least)
...
With pattern matching as an exception.
2023-01-16 14:39:47 +09:00
dearblue
365c151df0
Make mrb_env_unshare() call in mrb_vm_run()
...
Move the detachment of the "env" object, now done by `mrb_top_run()` by #5904 , to `mrb_vm_run()`.
This is because `mrb_vm_run()` can remove `mrb_env_unshare()` which is called from `bin/mirb`.
Also, even if the mruby VM is already running, either of the following conditions should be used to detach "env":
- If the `stack_keep` variable is 0.
- If the stack length of "env" is longer than `irep->nlocals`.
The reason for the change is that the stack beyond `irep->nlocals` is used inside the called method, and previously it was possible to reference and manipulate the state inside the method via "env".
env stack | |
main stack | top | m1 | m2 |
|<--------------->|
operable via env stack (including self)
If the problematic block is called from the `m2` method above, it is possible to replace `self` in `m1` and `m2` as well as the internal variables.
This change may cause compatibility problems, but I believe it is better to make `MRB_API`, `mrb_vm_run()` safe.
If a dangerous procedure is absolutely necessary, `mrb_vm_exec()` can still be called as before.
2023-01-15 18:16:42 +09:00
dearblue
e5108a6291
Fixed local variables not separated between copied binding objects
...
This is because I forgot to implement the `Binding#initialize_copy` method.
2021-08-03 23:20:34 +09:00