Commit Graph

15998 Commits

Author SHA1 Message Date
Yukihiro "Matz" Matsumoto 2b4591fe68 mruby-proc-binding: use presym for initialization 2024-06-14 01:45:23 +09:00
Yukihiro "Matz" Matsumoto 9fbdf78380 mruby-binding: use presym for initialization 2024-06-14 01:44:49 +09:00
Yukihiro "Matz" Matsumoto d1e49f7121 mruby-metaprog: use presym for initialization 2024-06-14 01:43:57 +09:00
Yukihiro "Matz" Matsumoto c32a94d878 mruby-string-ext: use presym for initialization 2024-06-14 01:43:03 +09:00
Yukihiro "Matz" Matsumoto 513908d77f mruby-range-ext: use presym for initialization 2024-06-14 01:42:30 +09:00
Yukihiro "Matz" Matsumoto 4104837ba1 mruby-hash-ext: use presym for initialization 2024-06-14 01:41:55 +09:00
Yukihiro "Matz" Matsumoto cfd90a65f7 mruby-array-ext: use presym for initialization 2024-06-14 01:41:06 +09:00
Yukihiro "Matz" Matsumoto 574f9f0d39 mruby-class_ext: use presym for initialization 2024-06-14 00:37:05 +09:00
Yukihiro "Matz" Matsumoto 6361f6d661 mruby-numeric-ext: use presym for initialization 2024-06-14 00:35:44 +09:00
Yukihiro "Matz" Matsumoto d94916bf15 mruby-kernel-ext: use presym for initialization 2024-06-14 00:34:07 +09:00
Yukihiro "Matz" Matsumoto e1a62a581f mruby-object-ext: use presym for initialization 2024-06-14 00:33:18 +09:00
Yukihiro "Matz" Matsumoto c99b8d7d3b mruby-fiber: use presym for initialization 2024-06-14 00:32:07 +09:00
Yukihiro "Matz" Matsumoto bf8e19f7da mruby-sleep: use presym for initialization 2024-06-14 00:30:32 +09:00
Yukihiro "Matz" Matsumoto 0eb616e3bd mruby-symbol-ext: use presym for initialization 2024-06-14 00:28:33 +09:00
Yukihiro "Matz" Matsumoto 3628d093f4 mruby-dir: use presym for initialization 2024-06-14 00:27:13 +09:00
Yukihiro "Matz" Matsumoto 6535f6d159 mruby-eval: use presym for initialization 2024-06-14 00:26:22 +09:00
Yukihiro "Matz" Matsumoto 9c060b425c mruby-errno: use presym for initialization 2024-06-14 00:25:26 +09:00
Yukihiro "Matz" Matsumoto e4c2423f6e mruby-catch: use presym for initialization 2024-06-14 00:23:11 +09:00
Yukihiro "Matz" Matsumoto 6bcaeb5a93 mruby-pack: use presym for initialization 2024-06-14 00:19:21 +09:00
Yukihiro "Matz" Matsumoto f3c2373c6f mruby-print: use presym for initialization 2024-06-14 00:18:22 +09:00
Yukihiro "Matz" Matsumoto c94ae288d5 mruby-time: use presym for initialization 2024-06-14 00:16:21 +09:00
Yukihiro "Matz" Matsumoto 8f184a356b mruby-random: use presym for initialization 2024-06-14 00:15:25 +09:00
Yukihiro "Matz" Matsumoto 3141b9424c mruby-compiler/y.tab.c: it will be generated by Lrama from parse.y
No longer need to bundle in the repository.
2024-06-10 15:34:16 +09:00
Yukihiro "Matz" Matsumoto 933e966fab tools/lrama: update template to stop C++ compiler error 2024-06-10 15:23:53 +09:00
Yukihiro "Matz" Matsumoto fbe21a0321 tools/lrama: bundle Lrama 0.6.9 (copied from CRuby source) 2024-06-10 14:26:26 +09:00
Yukihiro "Matz" Matsumoto d6da2d4760 mruby-compiler: use @1 in parse.y to enable YYLTYPE
This change itself does nothing good, but it is a preparation for the
future Bison to Lrama migration. As of 0.6.9, Lrama has a compatibility
issue for grammar files without `@n`.
2024-06-10 08:23:36 +09:00
Yukihiro "Matz" Matsumoto 473206c5d8 class.c: adjust local variable declarations with initialization 2024-06-10 08:23:36 +09:00
Yukihiro "Matz" Matsumoto b6b74b3a5b Merge pull request #6290 from dearblue/libdir
Allow to change the output directory name of the `libmruby` file
2024-06-10 08:22:52 +09:00
dearblue 0fcf54b47d Allow to change the output directory name of the libmruby file
Add the `MRuby::Build#libdir_name` accessor and the `MRUBY_SYSTEM_LIBDIR_NAME` environment variable.

Resolved #6240
2024-06-09 22:49:46 +09:00
Yukihiro "Matz" Matsumoto 43b3536803 Merge pull request #6288 from dearblue/closing
Detach `env` of ci explicitly on atexit
2024-06-09 19:40:21 +09:00
Yukihiro "Matz" Matsumoto b60cd351a1 Merge pull request #6289 from dearblue/orphan-block
Simplify `OP_RETURN_BLK` and `OP_BREAK
2024-06-08 23:51:48 +09:00
dearblue f48ac7469b Simplify OP_RETURN_BLK and `OP_BREAK
- There was some unnecessary complexity in `OP_BREAK` introduced in commit ad2e626 (#6282).
  - Since `mrb->c` is never NULL, there is no need to check it with `MRB_ENV_ONSTACK_P()` beforehand.
2024-06-08 13:46:28 +09:00
dearblue bd596153f1 Detach env of ci explicitly on atexit
Supplement to commit 177debacc5 (#6276).

If the ci is incomplete, the previous method may cause the application to crash because `env->stack` points to an invalid address when expanding the data stack.
Since the ci is in an abnormal state, control it by putting `NULL` in `env->stack`.

If the ci is fine and top-level, detach `env` as usual with `mrb_env_unshare()`.
2024-06-06 21:35:24 +09:00
Yukihiro "Matz" Matsumoto 8c1e12263e Merge pull request #6287 from mruby/dependabot/github_actions/super-linter/super-linter-6.6.0
build(deps): bump super-linter/super-linter from 6.5.1 to 6.6.0
2024-06-05 21:26:23 +09:00
Yukihiro "Matz" Matsumoto 889af10090 mruby-compiler: prohibit dynamic assignment to constants; #3521
Along with some declaration adjustments to minimize `y.tab.c` diff.
2024-06-05 18:56:11 +09:00
dependabot[bot] bc930d68ab build(deps): bump super-linter/super-linter from 6.5.1 to 6.6.0
Bumps [super-linter/super-linter](https://github.com/super-linter/super-linter) from 6.5.1 to 6.6.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/v6.5.1...v6.6.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-06-04 14:49:19 +00:00
Yukihiro "Matz" Matsumoto 5072358276 vm.c: remove unnecessary type cast to blk; ref #6282 2024-06-03 19:45:53 +09:00
Yukihiro "Matz" Matsumoto dcdd94c04c Merge pull request #6282 from dearblue/orphan-block
Delegate the care of a directly given block from `cipop()` to `cipush()`
2024-06-02 22:02:58 +09:00
Yukihiro "Matz" Matsumoto 95dcc52e16 Merge pull request #6283 from dearblue/env
Simplify `uvenv()`
2024-06-01 22:51:02 +09:00
dearblue d0b06446f2 Simplify uvenv()
The part removed in this patch was introduced by commit c7c9543bed.

The current mechanism should be able to trace from block objects created by `eval` to higher level blocks without any problems.
2024-06-01 20:36:22 +09:00
Yukihiro "Matz" Matsumoto 00a874cff6 Merge pull request #6281 from dearblue/binding
Fixes local variables in `mruby-binding`.
2024-05-31 22:56:04 +09:00
Yukihiro "Matz" Matsumoto 8d79cfdc83 Merge pull request #6280 from dearblue/env
Remove `MRB_ENV_CLOSED` flag
2024-05-31 22:50:56 +09:00
Yukihiro "Matz" Matsumoto 7b9b0997e0 string.c: adjust local variable declarations 2024-05-31 22:49:25 +09:00
dearblue ad2e626e7a Delegate the care of a directly given block from cipop() to cipush()
Outlines:
  - Removed `mrb_callinfo::blk`
  - Added `mrb_callinfo::flags`
  - Added `MRB_CI_COMPANION_BLOCK` flag
2024-05-31 22:03:15 +09:00
dearblue e82b36035e Fixes local variables in mruby-binding.
There are two issues to be fixed:
  - `mrb_irep` could leak if `mrb_calloc()` encountered an out-of-memory exception
  - `mrb_proc_merge_lvar()` allocated one extra variable name.

`irep->lv` can always refer to only one less range than `irep->nlocals`.
Also, when `mrb_proc_merge_lvar()` extends `irep->lv`, `mrb_realloc()` with `NULL` has the same behavior as `mrb_malloc()`.
2024-05-30 21:25:30 +09:00
dearblue 7ab6386cc6 Remove MRB_ENV_CLOSED flag
Set `env->cxt` to `NULL` when it is detached from the call frame.
In other words, we can determine if `env->cxt` is `NULL` or not.

Also, `mruby-binding` had been setting `env->cxt` unnecessarily, so this has been fixed.
2024-05-30 21:09:49 +09:00
Yukihiro "Matz" Matsumoto 0a11af74f4 Merge pull request #6279 from kou/windows-lean-and-mean-include
Include headers for malloc() explicitly; fix #6277
2024-05-29 14:37:10 +09:00
Sutou Kouhei c258ead85b Include headers for malloc() explicitly; fix #6277
We need to include stdlib.h and malloc.h to use malloc()/free() but
they aren't included in src/string.c with WIN32_LEAN_AND_MEAN. It
generates build time warnings.

We can solve this by including stdlib.h and malloc.h explicitly.
2024-05-29 09:45:36 +09:00
Yukihiro "Matz" Matsumoto f1dec3959f mruby-range-ext (range_size): raise TypeError if not iterable
According ruby/ruby#8663, `Range#size` behavior has changed.
2024-05-28 15:30:08 +09:00
Yukihiro "Matz" Matsumoto f2dc44215c Merge pull request #6276 from dearblue/closing
Always run `atexit` on the top-level call frame
2024-05-27 12:40:52 +09:00