summaryrefslogtreecommitdiffhomepage
path: root/src
AgeCommit message (Collapse)Author
2020-12-24Check integer overflow in float bit operations.Yukihiro "Matz" Matsumoto
2020-12-23Fix the integer overflow in `mrb_str_len_to_inum()`.Yukihiro "Matz" Matsumoto
2020-12-15Merge pull request #5223 from ↵Yukihiro "Matz" Matsumoto
shuujii/ensure-initialization-of-RVALUE_zero-in-mrb_obj_alloc Ensure initialization of `RVALUE_zero` in `mrb_obj_alloc`
2020-12-15refactor: remove trailing whitespace from C, Header, Ruby and YAML filesJohn Bampton
Lint
2020-12-15Ensure initialization of `RVALUE_zero` in `mrb_obj_alloc`KOBAYASHI Shuji
Union initialization initializes the first member. The first member of `RVALUE` is `struct free_obj`, but because it is only 4-words, it seems that initialization after the 5th word is not ensured. Therefore, I created 6-words `struct RVALUE_initializer` for initialization and made it the first member.
2020-12-13Fix spellingJohn Bampton
2020-12-12Remove positive check for unsigned integer; close #5218Yukihiro "Matz" Matsumoto
2020-12-07Make type of `pc` arguments in `debug.c` consistent; close #5218Yukihiro "Matz" Matsumoto
They used to be `size_t`, `uint32_t` and `ptrdiff_t`. Now all of them made to be `uint32_t`.
2020-12-05Fixed a bug with modules prepended many times.Yukihiro "Matz" Matsumoto
Adjust insertion point in `fix_prepend_module()`.
2020-12-04Make `Module#include` and `Module#prepend` behave like Ruby3.0.Yukihiro "Matz" Matsumoto
Module#include and Module#prepend now affect classes and modules that have already included or prepended the receiver, mirroring the behavior if the arguments were included in the receiver before the other modules and classes included or prepended the receiver. ```ruby class C; end module M1; end module M2; end C.include M1 M1.include M2 p C.ancestors #=> [C, M1, M2, Object, Kernel, BasicObject] ```
2020-12-02Print implicit operands for some instructions.Yukihiro "Matz" Matsumoto
2020-12-02Remove a newline.Yukihiro "Matz" Matsumoto
2020-12-01Revert "Create presym files for each build target" (58ba883e)KOBAYASHI Shuji
Due to the above changes, it may not work with the existing build configurations in cross-compilation (even if we can build without presym), therefore revert it once (ref https://github.com/mruby/mruby/pull/5202#issuecomment-735412643). Sorry for the lack of consideration.
2020-12-01Fix `OP_JMPUW` address bug.Yukihiro "Matz" Matsumoto
2020-11-30Merge pull request #5206 from dearblue/dumpirepYukihiro "Matz" Matsumoto
Improves dump irep
2020-11-30Integrate the output of the catch handler table into iseqdearblue
Alleviates confusingness. ref #5203
2020-11-30Fixed irep size measurement by dump; ref #5203dearblue
2020-11-30Fixed print catch handler address in codedump; ref #5200dearblue
It became 32 bits in #5200, but only the upper 16 bits were printed.
2020-11-29Use `MRB_SYM` in `src/gc.c`KOBAYASHI Shuji
2020-11-29Merge pull request #5203 from komainu8/fix-heap-buffer-overflowYukihiro "Matz" Matsumoto
Fix heap buffer overflow when dump irep
2020-11-29Fix heap buffer overflow when dump irepHorimoto Yasuhiro
Currently, the size of writing in heap by write_irep_record() is bigger than The size that is calculated by get_irep_record_size. Therefore, irep is dumped over the size of allocating memory when we execute dump_irep().
2020-11-29Change the catch handler address to 32 bitsdearblue
Follow commit 7150c6753933f12a2ba63769fb7b3a44cfcddd3d .
2020-11-26Create presym files for each build targetKOBAYASHI Shuji
Previously, presym files were always created in `build/{presym,presym.inc}`. However, this constraint is inconvenient because it is common to use multiple build configurations and build targets in a single mruby tree. Therefore, change to create presym file for each build target.
2020-11-26Fix a bug in `find_symbol()`; fix #5192Yukihiro "Matz" Matsumoto
2020-11-26Make `OP_JMP*` operand address to be relative.Yukihiro "Matz" Matsumoto
Jump target address is `operand (16bit)` + `address of next instruction`. In addition, `ilen` was made `uint32_t` so that `iseq` length limitation of 65536 is removed. Only jump target address should be within signed 16bit (-32768 .. 32767).
2020-11-26Small refactoring regarding symbols for clarity.Yukihiro "Matz" Matsumoto
2020-11-26Include `mruby.h` instead of `mrbconf.h` directly.Yukihiro "Matz" Matsumoto
2020-11-26Avoid memory leak when `mrb_read_irep()` fails.Yukihiro "Matz" Matsumoto
2020-11-25Move inline `iseq` in `array.c` to `array.rb`.Yukihiro "Matz" Matsumoto
There's no efficiency difference since `cdump` is implemented.
2020-11-25Fix C source compilation with `MRB_USE_ALL_SYMBOLS`; ref #5187KOBAYASHI Shuji
However, compiling by `mrbc` fails with another issue (#5116).
2020-11-24Add `#include <mrbconf.h>` at the head of `fmt_fp.c`; #5185Yukihiro "Matz" Matsumoto
2020-11-24Merge pull request #5186 from shuujii/optimize-presym_findYukihiro "Matz" Matsumoto
Optimize `presym_find`
2020-11-24Fix compiler errors from `MRB_NO_FLOAT`; #5185Yukihiro "Matz" Matsumoto
Also added `no-float.rb` target in `build_config`.
2020-11-24Optimize `presym_find`KOBAYASHI Shuji
Chang to compare string length first. ### Benchmark #### Code * https://github.com/shuujii/mruby-presym_find-benchmark #### Result ```console Previous: 10.240772M i/s (25M times in 2.441222s) New: 16.412985M i/s (25M times in 1.523184s) ```
2020-11-23Fix unintended variable shadowingWataru Ashihara
2020-11-22Remove `mrb_str_buf_new()` and `MRB_STR_BUF_MIN_SIZE`; close #5171Yukihiro "Matz" Matsumoto
2020-11-22Fix GC mark leaks for `MRB_TT_BREAK`; fix #5168dearblue
2020-11-22Fix size of local variable array in struct dumped fileKOBAYASHI Shuji
2020-11-22Merge pull request #5167 from dearblue/singleton-methodYukihiro "Matz" Matsumoto
Improved `Object#define_singleton_method`
2020-11-21Improved `Object#define_singleton_method`dearblue
Integrate the implementation with `Module#define_method`. - Introduce the internal function `mrb_mod_define_method_m()` (no static) - The `Object#define_singleton_method` method can now accept a second argument
2020-11-21Rename `MRB_{ENABLE,DISABLE}_` to `MRB_{USE,NO}_`; close #5163KOBAYASHI Shuji
| Previous Name | New Name | |------------------------------|-------------------------| | MRB_ENABLE_ALL_SYMBOLS | MRB_USE_ALL_SYMBOLS | | MRB_ENABLE_SYMBOLL_ALL | MRB_USE_ALL_SYMBOLS | | MRB_ENABLE_CXX_ABI | MRB_USE_CXX_ABI | | MRB_ENABLE_CXX_EXCEPTION | MRB_USE_CXX_EXCEPTION | | MRB_ENABLE_DEBUG_HOOK | MRB_USE_DEBUG_HOOK | | MRB_DISABLE_DIRECT_THREADING | MRB_NO_DIRECT_THREADING | | MRB_DISABLE_STDIO | MRB_NO_STDIO | | ENABLE_LINENOISE | MRB_USE_LINENOISE | | ENABLE_READLINE | MRB_USE_READLINE | | DISABLE_MIRB_UNDERSCORE | MRB_NO_MIRB_UNDERSCORE | | DISABLE_GEMS | MRB_NO_GEMS | * `MRB_ENABLE_SYMBOLL_ALL` seems to be a typo, so it is fixed. * `MRB_` prefix is added to those without. * The previous names can also be used for compatibility.
2020-11-21Merge pull request #5162 from ↵Yukihiro "Matz" Matsumoto
shuujii/move-some-.rake-files-to-tasks-directory-for-consistency Move some `.rake` files to `tasks` directory for consistency
2020-11-21Reserve `OP_SENDVK` for the future keyword arguments like Ruby3.0.Yukihiro "Matz" Matsumoto
2020-11-21Fix infinite loop bug from `super` when method is prepended.Yukihiro "Matz" Matsumoto
2020-11-21Fix module order of `#include`; ruby-bug:7844Yukihiro "Matz" Matsumoto
2020-11-21Unable for the `MRB_TT_CPTR` object to have a singleton classdearblue
This object is treated as an immediate value.
2020-11-21Move some `.rake` files to `tasks` directory for consistencyKOBAYASHI Shuji
2020-11-21Update `Float#to_s` to keep trailing zero as CRuby does; ref 68cebb6Yukihiro "Matz" Matsumoto
2020-11-20Refactor `src/mruby_core.rake`KOBAYASHI Shuji
2020-11-18Revert "Check if irep->reps is NULL in lv_defined_p"Yukihiro "Matz" Matsumoto