| Age | Commit message (Collapse) | Author |
|
|
|
|
|
Toplevel includes the top of the method/class/module definitions.
|
|
|
|
|
|
Fixing keyword arguments with `super`
|
|
|
|
|
|
fix #5627
|
|
ref. commit 7f40b645d2773c8f50c48ae4adf90488e164da55
Currently, the build configurations `MRB_USE_COMPLEX` and `MRB_USE_RATIONAL` are not listed in the documentation.
In other words, they are hidden settings.
They are defined in `mrbgems/mruby-{complex,rational}/mrbgem.rake`.
So this patch assumes that it is safe to refer to these functions in core-gems directly from core functions.
However, applications that link with `libmruby_core.a` will have compatibility issues.
In fact, `mrbgems/mruby-bin-mrbc` links with `libmruby_core.a`, so I had to prepare a dummy function.
|
|
Get object properties after `mrb_get_args()`
|
|
ref. #5613
I checked with Valgrind, and the methods that can cause use-after-free are `Array#rotate`, `Array#rotate!`, and `String#byteslice`.
Since `String#rindex` uses `RSTRING_LEN()` indirectly inside the function, no reference to the out-of-bounds range is generated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Allow void expression on some places e.g. right hand of `rescue`
modifier. In addition, checks added on some places, e.g. left hand of
logical operators.
|
|
Note that the current implantation only calls `[]=` method. No
performance improvement. Just 2 bytes less byte code per assignment.
|
|
Add `bin/mrbc --no-ext-ops` switch
|
|
Previously, it always pointed to the highest scope as the location of the error.
- example code `code.rb`
```ruby
huge_num = "1" + "0" * 300; eval <<CODE, nil, "test.rb", 1
class Object
module A
#{huge_num}
end
end
CODE
```
- Before this patch
```console
% bin/mruby code.rb
test.rb:1: integer too big
trace (most recent call last):
[1] code.rb:1
code.rb:1:in eval: codegen error (ScriptError)
```
- After this patch
```console
% bin/mruby code.rb
test.rb:3: integer too big
trace (most recent call last):
[1] code.rb:1
code.rb:1:in eval: codegen error (ScriptError)
```
|
|
Print an error if `OP_EXT[123]` is needed when generating mruby binary.
This may be useful for mruby/c.
Inspired by #5590.
|
|
|
|
With some refactoring.
* `ret` argument is always non-nil, so no check needed.
* move allocation check right after malloc().
* simplify conditions.
|
|
Ruby 1.9.2 feature.
ref: https://docs.ruby-lang.org/ja/3.1.0/method/Array/i/repeated_combination.html
ref: https://docs.ruby-lang.org/ja/3.1.0/method/Array/i/repeated_permutation.html
|
|
|
|
|
|
As a general principles numeric instructions should not be prefixed by
`OP_EXT` instructions since they are not supported by "mruby/c".
|
|
|
|
|
|
|
|
Align "wrong number of arguments" messages
|
|
Fixed compile error for `mrbgems/mruby-cmath` with `clang++`
|
|
Make "N for M" into the form "given N, expected M".
As I worked, I noticed that the `argnum_error()` function had a part to include the method name in the message.
I think this part is no longer needed by https://github.com/mruby/mruby/pull/5394.
- Before this patch
```console
% bin/mruby -e '[1, 2, 3].each 0'
trace (most recent call last):
[1] -e:1
-e:1:in each: 'each': wrong number of arguments (1 for 0) (ArgumentError)
```
- After this patch
```console
% bin/mruby -e '[1, 2, 3].each 0'
trace (most recent call last):
[1] -e:1
-e:1:in each: wrong number of arguments (given 1, expected 0) (ArgumentError)
```
|
|
If the preprocessor check part is only `__clang__`, CI's such as `Ubuntu-2004-clang` will fail to compile.
This is why we limited the addition to FreeBSD and OpenBSD, which have `clang++` in their base systems.
DragonFly BSD and NetBSD have GCC built into their base systems, so nothing is changed.
|
|
Both keyword arguments and block arguments were being destroyed when there were no arguments.
The cause of this is #5585. I' m sorry.
|
|
The `__id__` method implemented in the C function has `MRB_ARGS_NONE()` specified, but it is also effective in the following cases.
```ruby
p nil.__id__ opts: 1 rescue p :a
p nil.method(:__id__).call 1 rescue p :b
p nil.method(:__id__).call opts: 1 rescue p :c
p nil.method(:__id__).to_proc.call 1 rescue p :d
p nil.method(:__id__).to_proc.call opts: 1 rescue p :e
p nil.method(:__id__).unbind.bind_call nil, 1 rescue p :f
p nil.method(:__id__).unbind.bind_call nil, opts: 1 rescue p :g
p nil.__send__ :__id__, 1 rescue p :h
p nil.__send__ :__id__, opts: 1 rescue p :i
```
After applying this patch, all items will output symbols in the same way as CRuby.
For this purpose, add `MRB_PROC_NOARG` to `struct RProc::flags`.
|
|
|
|
Calling the `Method#{parameters,source_location}` method on a static `Proc` object resulted in `SIGSEGV`.
The trigger is https://github.com/mruby/mruby/pull/5402.
The original implementation of the `Method#{parameters,source_location}` method was to temporarily rewrite the object and then call the method of the same name in `Proc`.
Rewriting of objects placed in the ROM section by #5402 above is prohibited by hardware such as the CPU.
This caused a `SIGSEGV`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Run the task only once when `parse.y` is updated
|