summaryrefslogtreecommitdiffhomepage
path: root/src
AgeCommit message (Collapse)Author
2017-11-04The `bidx` saved in `env` may be useless; fix #3841Yukihiro "Matz" Matsumoto
When `block_given?` is called from a block given to `define_method` as a method body, the `bidx` may not be within `env` saved closure. In this case, it causes heap buffer overflow.
2017-11-04Avoid pointer arithmetic in backtrace.c; #3816Yukihiro "Matz" Matsumoto
2017-11-03Always check division-by-zero to avoid undefined behavior; fix #3816Yukihiro "Matz" Matsumoto
Also removed the code to normalize NaN value for `MRB_NAN_BOXING`. Tha code was added to fix #1712 but no longer required after 249f05e7d.
2017-11-03Should not use `FSHARED` state for string from `irep` pools; fix #3829Yukihiro "Matz" Matsumoto
This strings in `irep` pools may be freed forcefully in `mrb_irep_free`. This commit probably fixes #3817 as well.
2017-11-02don't overwrite backtrace info.Tomoyuki Sahara
2017-10-31Fixed constant (and class variable) reference bug; fix #3839Yukihiro "Matz" Matsumoto
Unlike method definition, constant reference should start from `MRB_PROC_TARGET_CLASS(ci->proc)`, not `ci->target_class`. In addition, `MRB_PROC_TARGET_CLASS(ci->proc)` is always set.
2017-10-31Call stack may not reference the destination `proc`; fix #3838Yukihiro "Matz" Matsumoto
The destination `proc` may be an orphan.
2017-10-31Need to mark fibers referenced from `env`; fix #3837Yukihiro "Matz" Matsumoto
The issue #3837 is a regression of #3819. I was mistakenly removed a important code to mark fibers from `env`.
2017-10-28Removed a debug printf; fix #3834Yukihiro "Matz" Matsumoto
2017-10-28Remove one of the lines that did the same thing; fix #3836Yukihiro "Matz" Matsumoto
The change is suggested by `ukrainskiysergey` in #3836. I deleted the other line for clarity. I also updated comment lines.
2017-10-28Should clear ensure stack at `OP_RETURN break`; #3715Yukihiro "Matz" Matsumoto
This is a resurrection of d0a7e01, which is accidentally removed by 93f5f22; Fix #3715
2017-10-28Should check if `callinfo` stack is popped before updating the stack.Yukihiro "Matz" Matsumoto
This is a resurrection of 75c374c, which is accidentally removed by 93f5f22; Fix #3507 #3512 #3518 #3521
2017-10-28Fixed UPVAR gotchas; fix #3835Yukihiro "Matz" Matsumoto
Both `uvenv` function and `env` generation in `create_proc_from_string` function have bugs to handling enclosed environment objects.
2017-10-28Remove a debug variableYukihiro "Matz" Matsumoto
2017-10-28Heavily refactored how lexical scope links are implemented; fix #3821Yukihiro "Matz" Matsumoto
Instead of `irep` links, we added a `upper` link to `struct RProc`. To make a space for the `upper` link, we moved `target_class` reference. If a `Proc` does not have `env`, `target_class` is saved in an `union` shared with `env` (if a `Proc` has env, you can tell it by `MRB_PROC_ENV_P()). Otherwise `target_class` is referenced from `env->c`. We removed links in `env` as well. This change removes 2 members from `mrb_irep` struct, thus saving 2 words per method/proc/block. This also fixes potential memory leaks due to the circular references caused by a link from `mrb_irep`.
2017-10-28Remove MRB_API from `mrb_env_unshare()`Yukihiro "Matz" Matsumoto
2017-10-28Format codedump for OP_{LE,LT,GE,GT}.Yukihiro "Matz" Matsumoto
2017-10-19Add `main.define_method`Yukihiro "Matz" Matsumoto
2017-10-17Remove `mrb_vm_get_argc`; ref #3826Yukihiro "Matz" Matsumoto
2017-10-17Merge branch 'fix-get-argc' of https://github.com/dabroz/mruby into ↵Yukihiro "Matz" Matsumoto
dabroz-fix-get-argc
2017-10-17Add `Numeric#{finite?,infinite?}`; CRuby2.4Yukihiro "Matz" Matsumoto
2017-10-17Remove top-level constant lookup; CRuby2.5Yukihiro "Matz" Matsumoto
2017-10-10correctly handle *splat arguments in mrb_get_argc, also add mrb_vm_get_argc ↵Tomasz Dąbrowski
and mrb_get_argv Fixes #3825
2017-10-01Use `uint32_t` to avoid signed integer overflow warning; #3816Yukihiro "Matz" Matsumoto
2017-10-01Add new type of shared string: `RSTR_FSHARED`.Yukihiro "Matz" Matsumoto
`RSTR_FSHARED` use frozen strings as shared body instead of `struct mrb_shared_string`. This reduces allocation from literal strings.
2017-09-29Cut links from `irep` in heaps finalization.Yukihiro "Matz" Matsumoto
2017-09-29`codedump` to display `OP_CALL`.Yukihiro "Matz" Matsumoto
2017-09-27fix: src\vm.c(2631): warning C4244: '=': conversion from 'mrb_int' to 'int', ↵Tomasz Dąbrowski
possible loss of data
2017-09-27fix: src\vm.c(1757): warning C4244: '=': conversion from 'mrb_int' to 'int', ↵Tomasz Dąbrowski
possible loss of data
2017-09-27fix: src\vm.c(1744): warning C4244: '=': conversion from 'mrb_int' to 'int', ↵Tomasz Dąbrowski
possible loss of data
2017-09-27fix: src\vm.c(1702): warning C4244: '=': conversion from 'mrb_int' to 'int', ↵Tomasz Dąbrowski
possible loss of data
2017-09-27fix: src\vm.c(708): warning C4244: '=': conversion from 'mrb_int' to 'int', ↵Tomasz Dąbrowski
possible loss of data
2017-09-27fix: src\vm.c(704): warning C4244: '=': conversion from 'mrb_int' to 'int', ↵Tomasz Dąbrowski
possible loss of data
2017-09-27fix: src\vm.c(457): warning C4244: '=': conversion from 'mrb_int' to 'int', ↵Tomasz Dąbrowski
possible loss of data
2017-09-27fix: src\vm.c(445): warning C4244: '=': conversion from 'mrb_int' to 'int', ↵Tomasz Dąbrowski
possible loss of data
2017-09-27fix: src\vm.c(438): warning C4244: '=': conversion from 'mrb_int' to 'int', ↵Tomasz Dąbrowski
possible loss of data
2017-09-27fix: src\string.c(2219): warning C4244: 'function': conversion from ↵Tomasz Dąbrowski
'mrb_int' to 'int', possible loss of data
2017-09-27fix: src\string.c(1924): warning C4244: '=': conversion from 'mrb_int' to ↵Tomasz Dąbrowski
'int', possible loss of data
2017-09-27fix: src\string.c(1130): warning C4244: '=': conversion from 'mrb_int' to ↵Tomasz Dąbrowski
'int', possible loss of data
2017-09-27fix: src\string.c(497): warning C4244: '=': conversion from 'mrb_int' to ↵Tomasz Dąbrowski
'long', possible loss of data
2017-09-27fix: src\state.c(66): warning C4200: nonstandard extension used: zero-sized ↵Tomasz Dąbrowski
array in struct/union
2017-09-27fix: src\range.c(136): warning C4244: '=': conversion from 'mrb_int' to ↵Tomasz Dąbrowski
'int', possible loss of data
2017-09-27fix: src\proc.c(96): warning C4244: 'function': conversion from 'mrb_int' to ↵Tomasz Dąbrowski
'int', possible loss of data
2017-09-27fix: src\pool.c(33): warning C4200: nonstandard extension used: zero-sized ↵Tomasz Dąbrowski
array in struct/union
2017-09-27fix: src\numeric.c(1215): warning C4244: 'function': conversion from ↵Tomasz Dąbrowski
'mrb_int' to 'int', possible loss of data
2017-09-27fix: src\numeric.c(954): warning C4334: '<<': result of 32-bit shift ↵Tomasz Dąbrowski
implicitly converted to 64 bits (was 64-bit shift intended?)
2017-09-27fix: src\numeric.c(897): warning C4244: 'function': conversion from ↵Tomasz Dąbrowski
'mrb_int' to 'mrb_float', possible loss of data
2017-09-27fix: src\kernel.c(874): warning C4244: 'function': conversion from 'mrb_int' ↵Tomasz Dąbrowski
to 'int', possible loss of data
2017-09-27fix: src\kernel.c(861): warning C4244: '=': conversion from 'mrb_int' to ↵Tomasz Dąbrowski
'int', possible loss of data
2017-09-27fix: src\hash.c(139): warning C4244: 'function': conversion from 'mrb_int' ↵Tomasz Dąbrowski
to 'khint_t', possible loss of data