Commit Graph

16446 Commits

Author SHA1 Message Date
Yukihiro "Matz" Matsumoto 28d2dfbb11 mruby-bin-mrbc: use MRB_DUMP_NO_LVAR flag
Instead of `mrb_irep_remove_lv()` function.
2024-11-29 16:45:26 +09:00
Yukihiro "Matz" Matsumoto 3a6272d9e9 mruby-bin-strip: use MRB_DUMP_NO_LVAR flags
Instead of `mrb_irep_remove_lv()` function.
2024-11-29 16:41:27 +09:00
Yukihiro "Matz" Matsumoto 5b69185171 dump.c (mrb_dump_irep): skip lv section if MRB_DUMP_NO_LVAR is set 2024-11-29 16:29:18 +09:00
Yukihiro "Matz" Matsumoto bd5ece3a26 dump.h: remove obsolete flag DUMP_DEBUG_INFO 2024-11-29 07:39:26 +09:00
Yukihiro "Matz" Matsumoto 4751e385c3 dump.h: add new dump flag MRB_DUMP_NO_LVAR 2024-11-29 07:38:47 +09:00
Yukihiro "Matz" Matsumoto 673d71ffca dump.c (mrb_dump_irep): reorganize if-structure 2024-11-28 10:14:06 +09:00
Yukihiro "Matz" Matsumoto 8a25c424a4 dump.c: remove unnecessary braces around return 2024-11-28 04:54:20 +09:00
Yukihiro "Matz" Matsumoto b1091e7c64 dump.c: use post-decrements 2024-11-28 04:54:19 +09:00
Yukihiro "Matz" Matsumoto a5c6cb5afb Merge pull request #6434 from dearblue/doc/hier 2024-11-28 04:53:55 +09:00
dearblue 26f949e612 Added document "The mruby directory structure"
This text was translated from Japanese to English by https://www.deepl.com/ .
2024-11-27 23:04:23 +09:00
Yukihiro "Matz" Matsumoto 3505874f72 Merge pull request #6437 from jbampton/pre-commit-config-add-more-details 2024-11-27 14:40:38 +09:00
Yukihiro "Matz" Matsumoto 85eeeda0b3 Merge pull request #6438 from dearblue/task/install 2024-11-27 14:36:21 +09:00
dearblue c7ca1038d2 Remove unused MRuby::Build#list_install_excludes method
This method was added by commit 0ac755dbc8 (#6407).
It was added during the initial conception, but was ultimately no longer needed.
2024-11-26 22:05:47 +09:00
Yukihiro "Matz" Matsumoto c96f0cd265 mruby-compar-ext (clamp): found a bug by newly added test
Translate CRuby's logic (in C) to Ruby.
2024-11-26 17:40:10 +09:00
Yukihiro "Matz" Matsumoto ec68c6afd8 mruby-compar-ext: add test for Comparable#clamp 2024-11-26 17:40:09 +09:00
Yukihiro "Matz" Matsumoto a6267a4145 Merge pull request #6436 from dearblue/doc/index 2024-11-26 13:35:27 +09:00
John Bampton 7fb6fdd4e2 Add more details to the pre-commit config 2024-11-25 22:49:30 +10:00
dearblue f42a55d9e0 Make rake doc:update-index prettier friendly 2024-11-25 21:32:14 +09:00
Yukihiro "Matz" Matsumoto 3ececd4f1f mruby-catch: fixed typo 2024-11-25 16:51:46 +09:00
Yukihiro "Matz" Matsumoto 1c317cf79e mruby-catch (throw_m): small refactoring 2024-11-25 12:28:50 +09:00
Yukihiro "Matz" Matsumoto 79dda053a5 mruby-numeric-ext: add test for Integer#digits 2024-11-23 23:16:47 +09:00
Yukihiro "Matz" Matsumoto 781359a1d1 Merge pull request #6432 from dearblue/hash 2024-11-22 09:53:10 +09:00
dearblue fd97241cd6 Moving code in macro arguments out of macros
In `src/hash.c`, there are code blocks that are passed as macro arguments.
These code blocks are interpreted as part of the macro function, so breakpoints cannot be set in the debugger.
Also, the gcov command will aggregate them to the caller, and the code in the block will not be counted.

This patch will prevent them from being interpreted as part of a macro, and thus the aforementioned problems will no longer occur.
2024-11-21 22:52:29 +09:00
Yukihiro "Matz" Matsumoto 87bd5c7abc Merge pull request #6409 from jbampton/add-prettier-config 2024-11-21 14:01:41 +09:00
Yukihiro "Matz" Matsumoto 1e41c47ebf Merge pull request #6429 from hoshiumiarata/fix_num_params_as_hash_key 2024-11-21 11:47:00 +09:00
Yukihiro "Matz" Matsumoto 4a54b551e8 hash.c (ht_set): inline ht_set_without_ib_adjustment() 2024-11-21 07:59:11 +09:00
Yukihiro "Matz" Matsumoto 3ad85e6038 Merge pull request #6431 from dearblue/typo 2024-11-21 07:58:55 +09:00
dearblue de494796ac Fixed typo 2024-11-20 21:14:55 +09:00
John Bampton a7c947360e [CI] Add prettier to pre-commit
Add `.prettierignore` and the `.prettierrc` config file. Prettier is currently targeting the `JSON`, `Markdown` and `YAML` files in the mruby repo.

Additional file types can be targetted with prettier via additional community plugins.

https://prettier.io/docs/en/

You can see all the languages that are supported on the homepage:

https://prettier.io/

This PR references a few other issues and PRs

We did have prettier running with pre-commit before that method was removed from prettier.

https://github.com/mruby/mruby/pull/6292

https://github.com/mruby/mruby/issues/6291

https://github.com/mruby/mruby/issues/6138

https://github.com/mruby/mruby/pull/5490

Perhaps we could add more npm software to pre-commit in future using new the `local` repo approach.

https://pre-commit.com/#repository-local-hooks

The best part is that it runs with pre-commit on our local machines on `git commit` and also when running `pre-commit run --all-files` or for example when running `make check`.

There were also some minor fixes / style changes in the pre-commit config to standardize casing.

https://www.npmjs.com/package/prettier?activeTab=readme
2024-11-20 14:51:11 +10:00
Yukihiro "Matz" Matsumoto dc5566e560 mruby-bigint (int_fit_limb_p): fix the logic to check mrb_int size
`int_fit_limb_p()` checks if `mrb_int` fits in `mp_limb`. Previous logic
did not work well with negative integers.
2024-11-20 11:27:54 +09:00
Yukihiro "Matz" Matsumoto 33357d4f35 hash.c (ht_set_without_ib_adjustment): need to skip tombstone; #6421
If a tombstone (a deleted entry slot) is found in searching the entry,
it should be skipped, but we had added the new entry even if the entry
to be replaced might be found in the further search. #6414 and #6421
tried to rehash the table to remove tombstone. But rehashing consumes
memory. So for the time being, we just skip tombstones in the search.
Maybe we will add some heuristics to rehash when the table has too many
tombstones. close #6414
2024-11-20 10:52:39 +09:00
Yukihiro "Matz" Matsumoto 9ea6bda781 Merge pull request #6427 from dearblue/vm-recursive 2024-11-20 07:22:12 +09:00
Yukihiro "Matz" Matsumoto 4953dcd81f Merge pull request #6428 from hoshiumiarata/change_limits_of_addi_and_subi 2024-11-20 06:37:19 +09:00
Hoshiumi Arata 386cd771e7 Fix numbered parameters when used as hash keys 2024-11-20 00:31:44 +09:00
Hoshiumi Arata d5823623ed Change the limits of OP_ADDI and OP_SUBI from 0-127 to 0-255. 2024-11-19 23:36:22 +09:00
Yukihiro "Matz" Matsumoto 9546207047 Merge pull request #6426 from hoshiumiarata/coverage
Add GitHub Actions workflow for coverage reporting
2024-11-19 22:55:37 +09:00
dearblue 0337e0e0f1 Need to update ci variable after re-entry to VM
Some functions called by `mrb_vm_exec()` involve re-entry into the mruby VM.
If the `ci` variable is not updated after re-entry, use-after-free is caused.

This patch makes the following after-call fixes.

| called                  | might call methods
| ----------------------- | ----------------
| `mrb_ary_splat()`       | `#to_a`
| `hash_new_from_regs()`  | `#eql?` `#hash`
| `mrb_hash_delete_key()` | `#eql?` `#hash`
| `mrb_hash_get()`        | `#eql?` `#hash` `#default`
| `mrb_hash_key_p()`      | `#eql?` `#hash`
| `mrb_hash_merge()`      | `#eql?` `#hash`
| `mrb_hash_set()`        | `#eql?` `#hash`
| `mrb_range_new()`       | `#<=>`
2024-11-19 22:47:04 +09:00
Hoshiumi Arata 0947dd64d0 Update coverage workflow to use Clang 18 for compilation 2024-11-19 18:24:40 +09:00
Hoshiumi Arata abca6549d8 Update coverage workflow to use Clang for compilation 2024-11-19 18:12:57 +09:00
Hoshiumi Arata 593cda570f Update retention days for coverage report in GitHub Actions workflow 2024-11-19 18:11:08 +09:00
Yukihiro "Matz" Matsumoto dbb1d2342f Merge pull request #6425 from mruby/dependabot/github_actions/super-linter/super-linter-7.2.0 2024-11-19 06:41:07 +09:00
Hoshiumi Arata 1fbcd4a39b Fix lint errors 2024-11-19 00:06:37 +09:00
Hoshiumi Arata f7b2ec1408 Fix formatting of coverage report in GitHub Actions workflow 2024-11-19 00:00:49 +09:00
Hoshiumi Arata 7cf5e9b0af Refactor coverage report generation in GitHub Actions workflow 2024-11-18 23:56:55 +09:00
dependabot[bot] cc76dda8a5 Bump super-linter/super-linter from 7.1.0 to 7.2.0
Bumps [super-linter/super-linter](https://github.com/super-linter/super-linter) from 7.1.0 to 7.2.0.
- [Release notes](https://github.com/super-linter/super-linter/releases)
- [Changelog](https://github.com/super-linter/super-linter/blob/main/CHANGELOG.md)
- [Commits](https://github.com/super-linter/super-linter/compare/v7.1.0...v7.2.0)

---
updated-dependencies:
- dependency-name: super-linter/super-linter
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-18 14:45:49 +00:00
Hoshiumi Arata fbcc6cf255 Update coverage workflow to trigger on pull requests 2024-11-18 23:29:17 +09:00
Hoshiumi Arata 6028be193c Add GitHub Actions workflow for coverage reporting 2024-11-18 23:19:28 +09:00
Yukihiro "Matz" Matsumoto b437b1da24 Merge pull request #6424 from MaxFork/max-add-check_command 2024-11-18 23:15:40 +09:00
Max Base f6106f62c7 Update Makefile - Add check_command 2024-11-17 14:43:21 +03:30
Yukihiro "Matz" Matsumoto f27bc6ab32 Merge pull request #6423 from dearblue/task/test 2024-11-17 07:52:50 +09:00