| Age | Commit message (Collapse) | Author |
|
zubycz-work_for_merge
|
|
|
|
|
|
Co-Authored-By: n4o847 <[email protected]>
Co-Authored-By: smallkirby <[email protected]>
|
|
This reverts commit 8746a6fe4e7bda8a0fbc0eaece9314ec51a0c255.
We already have `mrb_protect()`, `mrb_ensure()` and `mrb_rescue()`
functions. If you need to handle exceptions from C functions, use those
functions above.
|
|
`mrb_exc_protect()` takes two C functions, `body` to be executed first,
and `resc` to be executed when an error happens during `body` execution.
Since `mrb_exc_protect()` should be compiled with the proper compiler,
we will not see the problem like #5088 that was caused by `setjmp()` and
`throw` mixture.
|
|
|
|
|
|
Also fixed the size calculation of `irep` dump, that could cause memory
corruption.
|
|
To allow C++ compilation. Fix suggested by @dearblue.
|
|
Redirect `mrb_str_to_str` to `mrb_obj_as_string` via C macro.
Inspired by #5082
|
|
Those types are `uint16_t` in definition. Also we no longer need padding
for `iseq`.
|
|
The fix was proposed by @dearblue
|
|
The PR was from @cubicdaiya.
|
|
- `mrb_check_intern()` to return `mrb_value`
- `mrb_intern_check()` to return `mrb_sym` [NEW]
Other new functions:
- `mrb_intern_check_cstr()`
- `mrb_intern_check_str()`
|
|
Rename new functions:
- `mrb_convert_type(mrb,val,type,tname,method)`
=> `mrb_type_convert(mrb,val,type,tname,method)`
- `mrb_check_convert_type(mrb,val,type,tname,method)`
=> `mrb_type_convert_check(mrb,val,type,tname,method)`
Old names are defined by macros (support `tname` drop and
`char*` => `mrb_sym` conversion).
|
|
|
|
|
|
The mixture causes warnings on 64 bit Windows (VC).
|
|
You can now use `NEXT` within `switch` statement like 7c087eb.
|
|
|
|
On non-`gcc` compatible environment, `NEXT` is translated to `break`.
|
|
|
|
|
|
|
|
To silence some warnings. This change cancels part of 7ef3604134.
|
|
* `mrb_kwargs` structure reordered (`values` and `rest` come last)
* take symbols instead of C `char*`
|
|
In the past code, the current `callinfo (ci)` was modified, thus it was
possible to pop `ci` beyond the `cibase`, that could cause out of memory
bound access for the code like the following:
```ruby
def m2
lambda {
Proc.new {
return :return # return from the method
}
}.call.call
:never_reached
end
p m2
```
|
|
|
|
By definition `mrb_assert()` called only when `MRB_DEBUG` is defined too.
But make I wanted to make clear that the local variable `current_checkpoint_tag`
is only accessed when `MRB_DEBUG` is set by wrapping with `DEBUG_ONLY_EXPR()`.
|
|
|
|
To make packed inline symbols within 31 bits, because the new method
hash tables allows only 31 bits of symbols. They use top 1 bit to maek
unused slots.
|
|
Since `%u` of `mrb_sym` may be its MSB turned on.
|
|
|
|
Caused from combination of `mrb_int`, `int` and `size_t`..
|
|
From human readable (ASCII) string representation to binary dump of
IEEE754 in little endian.
|
|
They are basically the copy of instance variable tables. On my Linux
box, memory consumption of `mrbtest` measured by `valgrind` is:
- old: 17,683,830 bytes
- new: 14,283,749 bytes
|
|
|
|
It uses `mrb_str_new_lit()` internally, but it doesn't need to express
it in the name of the function (macro).
|
|
|
|
Where fixnum overflow can happen.
|
|
- Integrate `Fixnum` and `Integer`
- Remove `Integral`
- `int / int -> int`
- Replace `mrb_fixnum()` to `mrb_int()`
- Replace `mrb_fixnum_value()` to `mrb_int_value()`.
- Use `mrb_integer_p()` instead of `mrb_fixnum_p()`
|
|
They used to return `mrb_value` but now return `mrb_sym` for consistency
with other `intern` functions. If symbols are not defined, `check`
functions return `0`, instead of `nil` in the past.
It causes API incompatibility but I believe few people use those
functions out of the core, and those changes are very easy to handle,
hopefully.
|
|
As described in ISO 15.2.30.
|
|
We still have `#define MRB_TT_FIXNUM MRB_TT_INTEGER` for compatibility.
|
|
Trailing `.0` is removed from `Float#to_s` and `Float#inspect` at
9d08025b. However, I think the more human-readable format is better
for `Float#inspect`.
For example, in the `Float#to_s` format, the failure message is not
well understood when testing values including types by `eql?` (e.g.
`Numeric#step` test).
```ruby
assert "example" do
exp = 1.0
act = 1
assert_operator(exp, :eql?, act) #=> Expected 1 to be eql? 1.
end
```
|
|
* The `Fixnum` constant is now an alias for the `Integer` class.
* Remove `struct mrb_state::fixnum_class` member.
If necessary, use `struct mrb_state::integer_class` instead.
|
|
```console
$ bin/mruby -e 'p({1 => 2}.key?(1.0))'
true
```
```console
$ bin/mruby -e 'p({1 => 2}.key?(1.0))'
false
```
|
|
close #3123
|
|
|