summaryrefslogtreecommitdiffhomepage
path: root/src
AgeCommit message (Collapse)Author
2021-04-10Rename some internal functions; ref #5401Yukihiro "Matz" Matsumoto
2021-04-09Merge pull request #5400 from jbampton/fix-spellingYukihiro "Matz" Matsumoto
chore: fix spelling
2021-04-09Merge pull request #5401 from dearblue/mcallYukihiro "Matz" Matsumoto
Reorganize `mcall()` in `mruby-method`
2021-04-04Making a proc object static for a method with static irepdearblue
The following methods will be made static. - `Class#new` - `Proc#call` - `Kernel#catch` Previously, static const RProc could not be registered as a method, but this has been changed to allow it.
2021-04-03Reorganize `mcall()` in `mruby-method`.dearblue
Use `mrb_exec_irep()`. If possible, re-entry into the VM will be suppressed. Note that due to the effect of being a tail-call, the backtrace of `Method#call` will be lost, and it will look as if the target method was called directly. This change fixes the problem of infinite loops when redefining methods that make block calls using `mruby-method`. ```console % bin/mruby -e 'mm = method(:proc); define_method(:proc, ->(*a, &b) { mm.call(*a, &b) }); p proc { 1 }' trace (most recent call last): [257] -e:1 [256] -e:1:in proc [255] -e:1:in proc ...SNIP... [1] -e:1:in proc -e:1:in proc: stack level too deep (SystemStackError) ```
2021-04-03Make `mrb_exec_irep()` allow non-VM to enter.dearblue
Change the old `mrb_exec_irep()` as-is to static `mrb_exec_irep_vm()`. Extract the VM entry part from the old `exec_irep()` in `mruby-eval/src/eval.c` and make it the core of the new `mrb_exec_irep()`.
2021-04-03chore: fix spellingJohn Bampton
2021-04-03Fix build failures with `enable_debug` and `enable_cxx_abi`dearblue
Under C++, there is no implicit conversion from `int` to `enum`, which caused a compilation error.
2021-04-01vm.c: change the default error message for undefined `super` method.Yukihiro "Matz" Matsumoto
- (old) `undefined method 'foo'` - (new) `no superclass method 'foo'`
2021-03-31backtrace.c: change `missing-lineno` to `0` for cosmetic reason; #5394Yukihiro "Matz" Matsumoto
2021-03-31Merge pull request #5394 from fundamental/partial-backtraceYukihiro "Matz" Matsumoto
Add support for partial backtraces
2021-03-31vm.c: resolve `int` and `mrb_int` mixture.Yukihiro "Matz" Matsumoto
2021-03-30mrbc: Dump debug info with -g optionfundamental
Adds debug source information (line/file) when mrbc uses -g. This commit results in usable backtraces for all gems when build_config is setup with enable_debug.
2021-03-30Add support for partial backtracesfundamental
When debug information is omitted within ireps, show that a stack frame existed rather than silently hiding it.
2021-03-29src/vm.c: calling C function may raise global jumps; fix #5391Yukihiro "Matz" Matsumoto
2021-03-29Revert "Fix `SIGSEGV` with mruby-method + mruby-catch"revert-5391-throwYukihiro "Matz" Matsumoto
2021-03-29Merge pull request #5391 from dearblue/throwYukihiro "Matz" Matsumoto
Fix `SIGSEGV` with mruby-method + mruby-catch
2021-03-28numeric.c: function renaming.Yukihiro "Matz" Matsumoto
- `mrb_num_div_int(mrb,x,y)` -> `mrb_div_int(mrb,x,y)` - `mrb_num_div_flo(mrb,x,y)` -> `mrb_div_flo(x,y)` They are internal function not supposed to be used outside of the core.
2021-03-27Fix `SIGSEGV` with mruby-method + mruby-catchdearblue
Previously, the following code would cause a `SIGSEGV`. ```ruby mm = method(:throw) define_method(:throw, ->(*args) { mm.call(*args) }) catch { |tag| throw tag } ``` I think the reason is in the `mrb_yield_with_class()` function: - Even if a C function is called, `CI_ACC_SKIP` is used - `cipop()` is not done if globally jumping from a C function
2021-03-19complex.c: overhaul complex operators.Yukihiro "Matz" Matsumoto
- define `MRB_TT_COMPLEX` - change object structure (`struct RComplex`) - add memory management for `MRB_TT_COMPLEX` - avoid operator overloading as much as possible - as a result, performance improved a log - should work with and without `Rational` defined
2021-03-19rational.c: overhaul rational operators.Yukihiro "Matz" Matsumoto
- define `MRB_TT_RATIONAL` - change object structure (`struct RRational`) - add memory management for `MRB_TT_RATIONAL` - avoid operator overloading as much as possible - implement division overloading in C - as a result, performance improved a lot
2021-03-19numeric.c: avoid integer overflow; close #5384Yukihiro "Matz" Matsumoto
Since `mruby` does not have `Bignum`, `Float#divmod` could overflow, so it will return `Float` values when the divided value does not fit in `mrb_int`. This behavior will be changed when `Bignum` is introduced to `mruby` in the future.
2021-03-19`Float#divmod` with zero should cause `ZeroDivisionError`; #5384Yukihiro "Matz" Matsumoto
2021-03-18`Float::NAN/0` should be `Float::NAN`; ref a0b3378b3KOBAYASHI Shuji
#### Before this patch: ```console $ bin/mruby -e 'p(Float::NAN/0)' Infinity ``` #### After this patch (same as Ruby): ```console $ bin/mruby -e 'p(Float::NAN/0)' NaN ```
2021-03-18numeric.c: float zero division should be infinity with sign kept; fix #5382Yukihiro "Matz" Matsumoto
2021-03-17hash.c: `Hash#shift` to return `nil` when a hash is empty.Yukihiro "Matz" Matsumoto
It used to be return the default value if available, but it should ignore the default value for behavior consistency. CRuby will adopt this behavior too in the future. [ruby-bugs:16908]
2021-03-17range.c: fixed a begin-less ranges issue.Yukihiro "Matz" Matsumoto
2021-03-12codegen.c: fixed a typo.Yukihiro "Matz" Matsumoto
2021-03-12codegen.c: no integer overflow error in `codegen`; close #5376Yukihiro "Matz" Matsumoto
Add new pool value type `IREP_TT_BIGINT` and generate integer overflow error in the VM. In the future, `mruby` will support `Bignum` for integers bigger than `mrb_int` (probably using `mpz`).
2021-03-09Merge pull request #5375 from artichoke/mrb_cmp-presym-op-maroYukihiro "Matz" Matsumoto
bug(presym): Fix mrb_cmp declaration of <=> symbol for funcall
2021-03-07bug(presym): Fix mrb_cmp declaration of <=> symbol for funcallRyan Lopopolo
2021-03-08ISO C99 doesn't support unnamed unions; fix #5354Yukihiro "Matz" Matsumoto
2021-03-05Fix load 64-bit integer from mrb format; fix #5369KOBAYASHI Shuji
2021-03-01dump.c: remove operator_table if `MRB_NO_STDIO` is defined.Yukihiro "Matz" Matsumoto
2021-02-28Remove periods from error messages according to the convention.Yukihiro "Matz" Matsumoto
2021-02-27state.c: remove `stdint.h` inclusion.Yukihiro "Matz" Matsumoto
Fixes C++03 compilation.
2021-02-26state.c: check irep reference count overflow.Yukihiro "Matz" Matsumoto
2021-02-22Added other methods for `Binding`dearblue
- Added to `mruby-binding-core` - `Binding#local_variable_defined?` - `Binding#local_variable_get` - `Binding#local_variable_set` - `Binding#local_variables` - `Binding#receiver` - `Binding#source_location` - `Binding#inspect` - Added to `mruby-proc-binding` - `Proc#binding` The reason for separating `Proc#binding` is that core-mrbgems has a method that returns a closure object to minimize possible problems with being able to manipulate internal variables. By separating it as different mrbgem, each user can judge this problem and incorporate it arbitrarily.
2021-02-22Adjustment of the current HEAD and bindings, and separationdearblue
Make changes to make `Binding` work. At the same time, it separates `Binding#eval`, which depends on `mruby-eval`, from `mruby-binding-core`.
2021-02-22print.c: fix a compilation errors with `MRB_NO_STDIO`; fix #5361Yukihiro "Matz" Matsumoto
2021-02-19Check `MRB_TT_*` before object allocation; ref #5352Yukihiro "Matz" Matsumoto
2021-02-18Merge pull request #5352 from ↵Yukihiro "Matz" Matsumoto
shuujii/fix-type-tag-that-set-to-NilClass-and-FalseClass Fix type tag that set to `NilClass` and `FalseClass`
2021-02-17Merge pull request #5347 from ↵Yukihiro "Matz" Matsumoto
shuujii/add--s-option-to-mrbc-for-make-variable-static Add `-s` option to `mrbc` for make variable static
2021-02-16Update URL explaining alignment issue; close #5344Yukihiro "Matz" Matsumoto
2021-02-14Fix type tag that set to `NilClass` and `FalseClass`KOBAYASHI Shuji
2021-02-14Place optable in ROMdearblue
2021-02-14Add `-s` option to `mrbc` for make variable staticKOBAYASHI Shuji
2021-02-13chore: fix missing HTTPS on linksJohn Bampton
2021-02-12Avoid possibility of reading uninitialized areas in `h_check_modified()`KOBAYASHI Shuji
In `h_check_modified()`, in the case of `MRB_NO_BOXING`, `ht_ea()` or `ht_ea_capa()` for AR may read uninitialized area. Therefore, do not use those macros for AR in `MRB_NO_BOXING` (but in the case of `MRB_64BIT`, `ht_ea_capa()` is the same as `ar_ea_capa()`, so use it). fix #5332
2021-02-12src/print.c: stop warning with `MRB_NO_STDIO`.Yukihiro "Matz" Matsumoto