summaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)Author
2021-07-15Merge pull request #4141 from udzura/add-test-for-attr-nil-guardYukihiro "Matz" Matsumoto
Add a testcase of #4137 fix
2021-07-15Merge pull request #5507 from ↵Yukihiro "Matz" Matsumoto
mruby/dependabot/github_actions/github/super-linter-4.4.1 build(deps): bump github/super-linter from 4.3.0 to 4.4.1
2021-07-14build(deps): bump github/super-linter from 4.3.0 to 4.4.1dependabot[bot]
Bumps [github/super-linter](https://github.com/github/super-linter) from 4.3.0 to 4.4.1. - [Release notes](https://github.com/github/super-linter/releases) - [Commits](https://github.com/github/super-linter/compare/v4.3.0...v4.4.1) --- updated-dependencies: - dependency-name: github/super-linter dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]>
2021-07-14Merge pull request #5506 from ↵Yukihiro "Matz" Matsumoto
mruby/dependabot/github_actions/github/super-linter-4.3.0 build(deps): bump github/super-linter from 4.2.2 to 4.3.0
2021-07-13build(deps): bump github/super-linter from 4.2.2 to 4.3.0dependabot[bot]
Bumps [github/super-linter](https://github.com/github/super-linter) from 4.2.2 to 4.3.0. - [Release notes](https://github.com/github/super-linter/releases) - [Commits](https://github.com/github/super-linter/compare/v4.2.2...v4.3.0) --- updated-dependencies: - dependency-name: github/super-linter dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]>
2021-07-12load.c: call `mrb_top_run()` from `mrb_load_proc()`; fix #5504Yukihiro "Matz" Matsumoto
So that the function behave consistently with `mrb_load_proc()`.
2021-07-11TODO.md: update.Yukihiro "Matz" Matsumoto
2021-07-10numeric.c: `self` should always be an integer in `__coerce_step_counter`.Yukihiro "Matz" Matsumoto
2021-07-10Update internal methods not to be listed in backtraces.Yukihiro "Matz" Matsumoto
- String#__lines - Array#__ary_eq - Array#__ary_cmp - Hash#__delete - Kernel#__case_eqq - Integer#__coerce_step_counter
2021-07-10Merge pull request #5503 from ntl/correct-header-files-when-cdump-disabledYukihiro "Matz" Matsumoto
Mrbgem gem_init.c: add headers for irep loading when cdump is disabled, but presym is enabled
2021-07-10Merge pull request #5505 from dearblue/stdintYukihiro "Matz" Matsumoto
Do not include `stdint.h` before `mruby.h`
2021-07-09Do not include `stdint.h` before `mruby.h`dearblue
2021-07-09Mrbgem gem_init.c compilation correctionNathan Ladd
When `disable_cdump` is declared on a Mrbgem spec, the procedure for loading MRuby code from the gem's `mrblib` directory is slightly different; instead of loading the mrblib code as a Proc built from the compiled irep, the compiled irep is loaded directly. The header files `mruby.h` and `mruby/proc.h` are needed only when the irep is loaded directly. They are currently included only when presym is disabled, they should be included whenever either presym is disabled *or* when `disable_cdump` is called. The `cdump?` predicate method happens to return true in either case (presym disabled *or* cdump disabled), so this change should be safe.
2021-07-09debug.h: use `uint8_t` instead of `char` for BER compressed binary.Yukihiro "Matz" Matsumoto
A change in `load.c` is left uncommitted.
2021-07-09debug.h: use `uint8_t` instead of `char` for BER compressed binary.Yukihiro "Matz" Matsumoto
2021-07-09cdump.c: avoid uninitialized local variable.Yukihiro "Matz" Matsumoto
2021-07-09range.c: avoid implicit conversion from `mrb_float` to `mrb_int`.Yukihiro "Matz" Matsumoto
2021-07-09codegen.c: avoid uninitialized local variable.Yukihiro "Matz" Matsumoto
2021-07-08range.c: should not include internal `__num_to_a` in the backtrace.Yukihiro "Matz" Matsumoto
2021-07-08backtrace.c: skip C method without `mid` set.Yukihiro "Matz" Matsumoto
That means it's a method not to be included in the backtrace, for example `raise`.
2021-07-08pack.c: fix integer signedness mixture.Yukihiro "Matz" Matsumoto
2021-07-08mruby-bin-debugger: remove unused local variables.Yukihiro "Matz" Matsumoto
2021-07-08mruby-bin-debugger: support `mrb_debug_line_packed_map`.Yukihiro "Matz" Matsumoto
2021-07-08debug.c: new debug line information format `mrb_debug_line_packed_map`.Yukihiro "Matz" Matsumoto
It uses BER number compression of delta of instruction positions and line numbers. BER compression is a variable length number representation. * `mrb_debug_line_ary`: array of line numbers represented in `uint16_t`. `[lineno, lineno, ...]` * `mrb_debug_line_flat_map`: array of `mrb_irep_debug_info_line`, which is `struct {uint32_t pos; uint16_t lineno}`, for each line. * `mrb_debug_line_packed_map` [new]: sequence of BER compressed 2 numbers, `pos_delta, lineno_delta`. Deltas are differences from previous values (starting `0`). `line_entry_counts` represents total length of a packed map string for this type.
2021-07-08mruby-bin-debugger: rename prefix 'mrb_debug_' to `mrdb_`.Yukihiro "Matz" Matsumoto
2021-07-08Merge pull request #5502 from jbampton/add-docs-yamllintYukihiro "Matz" Matsumoto
Add information on yamllint as comments
2021-07-07Add information on yamllint as commentsJohn Bampton
2021-07-07Merge pull request #5501 from jbampton/update-contributing-guideYukihiro "Matz" Matsumoto
Style the CONTRIBUTING guide
2021-07-07Style the CONTRIBUTING guideJohn Bampton
2021-07-06Merge branch 'cremno-mrb_debug_strdup-and-strndup'Yukihiro "Matz" Matsumoto
2021-07-06Merge branch 'mrb_debug_strdup-and-strndup' of ↵Yukihiro "Matz" Matsumoto
https://github.com/cremno/mruby into cremno-mrb_debug_strdup-and-strndup
2021-07-05Make `LocalJumpError` a direct subclass of `StandardError`.Yukihiro "Matz" Matsumoto
To be compatible with CRuby.
2021-07-04codegen.c: jump address should be generated by `gen_jmpdst()`.Yukihiro "Matz" Matsumoto
2021-07-03ops.h: made terms consistent.Yukihiro "Matz" Matsumoto
- `Lit` -> `Pool` - `SEQ` -> `Irep`
2021-07-03Update `.git-blame-ignore-revs` to skip a reformatting commit.Yukihiro "Matz" Matsumoto
2021-07-03doc/opcode.md: table reformatted.Yukihiro "Matz" Matsumoto
2021-07-03vm.c: `OP_DEF` to push a symbol to `a` register.Yukihiro "Matz" Matsumoto
The code generator no longer need to emit `OP_LOADSYM` after `OP_DEF`. `doc/opcode.md` is also updated.
2021-07-02vm.c: need to adjust `pc` for `OP_EXT[123]`.Yukihiro "Matz" Matsumoto
2021-07-02error.c: `mrb_obj_as_string` and `mrb_inspect` may return non-object (`undef`).Yukihiro "Matz" Matsumoto
2021-07-01AUTHORS: update.Yukihiro "Matz" Matsumoto
2021-06-30Revert "Remove `OP_EXT[123]` from operands."Yukihiro "Matz" Matsumoto
This reverts commit fd10c7231906ca48cb35892d2a86460004b62249. I thought it was OK to restrict index value within 1 byte, but in some cases index value could be 16 bits (2 bytes). I had several ideas to address the issue, but reverting `fd10c72` is the easiest way. The biggest reason is `mruby/c` still supports `OP_EXT[123]`, so that they don't need any additional work.
2021-06-29string.rb: `upto` to break when the string length is longer than `end`.Yukihiro "Matz" Matsumoto
2021-06-29Merge pull request #5497 from dearblue/drop-upperYukihiro "Matz" Matsumoto
Drop unnecessary upper procs linked from class/module/def syntax
2021-06-29Merge pull request #5498 from dearblue/ruby-warnsYukihiro "Matz" Matsumoto
Avoid warnings with `ruby -cw`
2021-06-28Avoid warnings with `ruby -cw`dearblue
```console % for rb in `git ls-files '*/mrblib/*.rb' 'mrblib'`; do ruby30 -cw $rb > /dev/null; done mrbgems/mruby-array-ext/mrblib/array.rb:389: warning: assigned but unused variable - ary mrbgems/mruby-array-ext/mrblib/array.rb:663: warning: assigned but unused variable - len mrbgems/mruby-hash-ext/mrblib/hash.rb:119: warning: possibly useless use of a variable in void context mrbgems/mruby-hash-ext/mrblib/hash.rb:259: warning: assigned but unused variable - keys mrbgems/mruby-io/mrblib/io.rb:229: warning: literal in condition mrbgems/mruby-io/mrblib/io.rb:280: warning: literal in condition mrbgems/mruby-string-ext/mrblib/string.rb:347: warning: assigned but unused variable - len mrbgems/mruby-toplevel-ext/mrblib/toplevel.rb:2: warning: parentheses after method name is interpreted as an argument list, not a decomposed argument ```
2021-06-28Drop unnecessary upper procs linked from class/module/def syntaxdearblue
It does not need to hold an anonymous proc for constant search. Also, this change can be expected to cause an anonymous proc to be GC'd. This is useful for metaprogramming that makes heavy use of the `class`/`module`/`def` syntax in the `class_eval`/`eval` method. Example: - code ```ruby p ObjectSpace.count_objects String.class_eval do def a end end p ObjectSpace.count_objects String.class_eval do eval <<~CODE def b end CODE end p ObjectSpace.count_objects ``` - result of building mruby-head (d63c0df6b) with `build_config/default.rb` ``` {:TOTAL=>1024, :FREE=>262, :T_PROC=>495, :T_ENV=>61, ...} {:TOTAL=>1024, :FREE=>259, :T_PROC=>497, :T_ENV=>62, ...} {:TOTAL=>1024, :FREE=>255, :T_PROC=>500, :T_ENV=>63, ...} ``` - result of building mruby with this patch and `build_config/default.rb` ``` {:TOTAL=>1024, :FREE=>264, :T_PROC=>494, :T_ENV=>60, ...} {:TOTAL=>1024, :FREE=>262, :T_PROC=>495, :T_ENV=>61, ...} {:TOTAL=>1024, :FREE=>261, :T_PROC=>496, :T_ENV=>61, ...} ```
2021-06-28Merge pull request #5493 from dearblue/binding.2Yukihiro "Matz" Matsumoto
Fixed finding variables from `proc` in `binding.eval` failed
2021-06-27Merge pull request #5495 from dearblue/eval.2Yukihiro "Matz" Matsumoto
Fixed finding variables defined in the upper proc failed
2021-06-26Fixed finding variables from `proc` in `binding.eval` faileddearblue
Previously the following code did not produce the expected results: ```ruby bx = binding block = bx.eval("a = 1; proc { a }") bx.eval("a = 2") p block.call # Expect 2 but return 1 due to a bug ``` The previous implementation of `Binding#eval` evaluated the code and then merged the top layer variables. This patch will parse and expand the variable space before making a call to `eval`. This means that the call to `Binding#eval` will do the parsing twice. In addition, the following changes will be made: - Make `mrb_parser_foreach_top_variable()`, `mrb_binding_extract_proc()` and `mrb_binding_extract_env()` functions private global functions. - Remove the `posthook` argument from `mrb_exec_irep()`. The `posthook` argument was introduced to implement the `binding` method. This patch is unnecessary because it uses a different implementation method. ref #5362 fixed #5491
2021-06-26Merge pull request #5494 from dearblue/eval.1Yukihiro "Matz" Matsumoto
Fix memory leak in `Kernel#eval`