Commit Graph

13651 Commits

Author SHA1 Message Date
dearblue dfddb04063 Use standardized approach for get build configuration name 2022-03-06 15:27:50 +09:00
Yukihiro "Matz" Matsumoto 2dff7ed6a2 mrbc.c: add --no-optimize option to disable optimization; close #5661 2022-03-05 08:04:34 +09:00
Yukihiro "Matz" Matsumoto 41f5f464ae codegen.c: disable constant folding if no_optimize is set; ref #5661 2022-03-05 08:04:33 +09:00
Yukihiro "Matz" Matsumoto 7528c25aae string.c: remove unnecessary mrb_assert_int_fit(). 2022-03-05 08:04:33 +09:00
Yukihiro "Matz" Matsumoto 47cb831369 Merge pull request #5662 from mruby/dependabot/github_actions/actions/upload-artifact-3
build(deps): bump actions/upload-artifact from 2.3.1 to 3
2022-03-04 23:08:59 +09:00
dependabot[bot] d6e69ffef8 build(deps): bump actions/upload-artifact from 2.3.1 to 3
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 2.3.1 to 3.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v2.3.1...v3)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-04 14:07:02 +00:00
Yukihiro "Matz" Matsumoto 278f46f971 unpack.c: check if srcidx is shorter than srclen for safety. 2022-03-04 14:19:10 +09:00
Yukihiro "Matz" Matsumoto bc9476e7ca unpack.c: unpack_BER() did assume the string length is not zero. 2022-03-04 14:18:20 +09:00
Yukihiro "Matz" Matsumoto 31d4bbcfea string.c: improve size/capacity check before allocations. 2022-03-04 14:17:21 +09:00
Yukihiro "Matz" Matsumoto 876bcba694 string.c: avoid integer type mixture in mrb_str_cat(). 2022-03-03 16:29:54 +09:00
Yukihiro "Matz" Matsumoto 85c347c3af codegen.c: fix a bug in super with keyword arguments; fix #5660 2022-03-03 14:48:39 +09:00
Yukihiro "Matz" Matsumoto ef3a56c92b error.c: (mrb_exc_new) use mrb_int instead of size_t. 2022-03-03 14:48:39 +09:00
Yukihiro "Matz" Matsumoto b6531fa691 error.h: remove obsolete macro mrb_exc_new_str_lit(). 2022-03-03 14:48:39 +09:00
Yukihiro "Matz" Matsumoto c3f0f84da5 string.c: remove code duplication using str_init_modifiable(). 2022-03-03 14:48:29 +09:00
Yukihiro "Matz" Matsumoto 1a9991f165 string.c: remove unnecessary size check before string initialization. 2022-03-03 08:08:02 +09:00
Yukihiro "Matz" Matsumoto a9bde42641 string.c: small refactoring (open else clause after return). 2022-03-03 08:08:02 +09:00
Yukihiro "Matz" Matsumoto a4f740ff9a string.c: use mrb_int instead of size_t. 2022-03-03 08:08:02 +09:00
Yukihiro "Matz" Matsumoto 51a3317c5b string.c: check integer overflow using mrb_int_mul_overflow(). 2022-03-03 08:08:01 +09:00
Yukihiro "Matz" Matsumoto 0bf1ed9f2c array-ext/array.c: remove unused local variable. 2022-03-03 08:08:01 +09:00
Yukihiro "Matz" Matsumoto 84b5b4c6bf Merge pull request #5658 from mruby/dependabot/github_actions/actions/checkout-3
build(deps): bump actions/checkout from 2.4.0 to 3
2022-03-03 08:06:39 +09:00
dependabot[bot] d6ac7a3a7d build(deps): bump actions/checkout from 2.4.0 to 3
Bumps [actions/checkout](https://github.com/actions/checkout) from 2.4.0 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2.4.0...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-02 14:10:07 +00:00
Yukihiro "Matz" Matsumoto 1508da4740 array.c: check integer overflow in mrb_ary_set(). 2022-03-01 15:04:08 +09:00
Yukihiro "Matz" Matsumoto 9d8f3c60ff kernel.c: inline mrb_obj_extend() that is called only from one place. 2022-02-28 19:07:31 +09:00
Yukihiro "Matz" Matsumoto 740083eb72 AUTHORS: update entries [ci skip] 2022-02-27 23:42:45 +09:00
Yukihiro "Matz" Matsumoto 57540fbf6c object.c: improve handling of the broken inspect method.
When `inspect` method returns non-string value, it will return a string
given from `to_s` (and if `to_s` fails, will raise an exception).
2022-02-26 22:01:52 +09:00
Yukihiro "Matz" Matsumoto 5305c5c84d array.c: call mrb_ary_delete_at() directly from Array#slice!.
Avoid `mrb_funcall()`.
2022-02-26 14:21:35 +09:00
Yukihiro "Matz" Matsumoto b118ba9fb3 rational.c: avoid indirect calls using mrb_funcall(). 2022-02-25 17:53:55 +09:00
Yukihiro "Matz" Matsumoto 64d9808575 Merge pull request #5656 from suetanvil-misc/bug-missing-yaml
Added a dependency on 'yaml' to load_gems.rb.
2022-02-24 18:45:24 +09:00
Chris Reuter 73df87f7bd Added a dependency on 'yaml' to load_gems.rb.
It appears that some execution paths no longer load YAML before it is
needed so we explicitly `require` it here.
2022-02-23 14:23:57 -05:00
Yukihiro "Matz" Matsumoto c75dfad796 Merge pull request #5638 from suetanvil-misc/project-git-path-clash
Refactored load_gems.rb to be simpler and easier to understand.
Gracefully handle the case where multiple gems use the same git check out path.
2022-02-23 16:11:28 +09:00
Chris Reuter 8d1ffa8a11 Refactored load_gems.rb to be simpler and easier to understand:
- Converted LoadGems::load_special_path_gems() into a class, then
  subdivided the various types of gem dependencies into smaller
  private methods.

- Added class GemDepDetails to hold the relationship between a gem's
  location on the local disk and its upstream repository.  This will
  be used later.

- Removed the last remains of the '--pull-gems' option from the code
  base and documentation.  This is no longer present and the dead code
  is clutter.

Gracefully handle the case where multiple gems use the same git checkout path.

Previously, if two gems had the same directory name when cloning them
from git, mrbgems would assume they were the same gem.  This also
applied to different branches and/or commits of the same repository.
This led to a strange situation where the first `conf.gem` statement
"won" in cloning the repository but the last `conf.gem` ended up
choosing the branch/commit-id to use.

This change detects this situation and makes it an error.  It also
allows the config writer to explicitly specify a gem checkout to use
in place of the others.
2022-02-23 16:08:15 +09:00
Yukihiro "Matz" Matsumoto 776be1b397 codegen.c: use OP_ARRAY instead of OP_ARRAY2 in optimization.
If operand 1 and operand 2 specify the same register `OP_ARRAY2`
can/should be transformed to `OP_ARRAY`.
2022-02-22 19:28:40 +09:00
Yukihiro "Matz" Matsumoto d4d29b21b3 codegen.c: peephole optimize OP_MOVE after OP_ARRAY or OP_ARRAY2. 2022-02-22 17:27:24 +09:00
Yukihiro "Matz" Matsumoto c37f648552 codegen.c: use OP_ARRAY instead of OP_ARRAY2 if possible.
`OP_ARRAY` inline elements, i.e: with `OP_ARRAY Rn Rm len`, `Rn` and
`Rm` should always be the same register.
2022-02-22 17:21:51 +09:00
Yukihiro "Matz" Matsumoto 75e86dcfcd codegen.c: assign post assignees for fixed number of RHS. 2022-02-22 17:20:00 +09:00
Yukihiro "Matz" Matsumoto ae231924a9 parse.y: small refactoring in mrb_parser_dump(). 2022-02-22 16:46:02 +09:00
Yukihiro "Matz" Matsumoto 0282d3ec9f codegen.c: rename gen_vmassinment to gen_massignment.
`m` stands for `multiple` but I don't remember why I put `v` first.
2022-02-22 16:43:51 +09:00
Yukihiro "Matz" Matsumoto 80b44c6ade socket.c: avoid mrb_funcall_id() to retrieve file descriptor. 2022-02-22 11:46:02 +09:00
Yukihiro "Matz" Matsumoto 0fbdfaa831 Merge pull request #5652 from dearblue/check-type
Need to check the type of the method return value
2022-02-22 11:10:18 +09:00
Yukihiro "Matz" Matsumoto f72315575f codegen.c: fix a argument generation bug in array assignment. 2022-02-22 11:06:20 +09:00
Yukihiro "Matz" Matsumoto 349307ba88 codedump.c: do not print nameless registers. 2022-02-21 11:46:34 +09:00
Yukihiro "Matz" Matsumoto ce3b1c4780 SECURITY.md: added memory allocation error as a non security issue.
mruby expects `malloc(3)` returns `NULL` for too big allocations, so
even if big object allocation (e.g.  `[1,2,3]*268888888888888818`)
caused ASAN/Valgrind warnings, it's intentional, and we won't consider
the warning as a security issue.
2022-02-20 18:39:34 +09:00
Yukihiro "Matz" Matsumoto 5d9239c2c4 Merge pull request #5653 from dearblue/doc-keywords
Improved documentation for `struct mrb_kwargs` [ci skip]
2022-02-20 16:40:11 +09:00
dearblue d7c09fb24a Improved documentation for struct mrb_kwargs [ci skip]
- Changed the description to match the order of the changed members.
- Replaced "array of symbols" instead of "array of strings that mean symbols".
- The `mrb_kwargs::optional` member has not been present since the first merge. It is a remnant from development time.
- Removed `const` modifier used in variable declarations in examples. This is not always necessary from a user perspective.
- Added note on the use of `MRB_SYM()`.

resolved #5649
2022-02-19 21:55:52 +09:00
Yukihiro "Matz" Matsumoto 44f591aa8f codegen.c: adjust stack position for OP_SUPER instruction. 2022-02-19 16:17:33 +09:00
Yukihiro "Matz" Matsumoto f906ac314c Merge pull request #5651 from dearblue/doc3.1
Update `doc/mruby3.1.md`
2022-02-19 15:49:44 +09:00
dearblue 621cafde68 Need to check the type of the method return value 2022-02-19 15:01:46 +09:00
dearblue 401d316bcf Update doc/mruby3.1.md
- `OP_GETIDX`, `OP_SETIDX` : Fix operand number
- `OP_SYMBOL` : Add entry
2022-02-19 14:39:17 +09:00
Yukihiro "Matz" Matsumoto 5a014997ef Merge pull request #5650 from dearblue/keywords
Insert an empty hash before the first `NODE_KW_REST_ARGS`
2022-02-19 10:25:11 +09:00
dearblue 12d51807a3 Insert an empty hash before the first NODE_KW_REST_ARGS
I expect this will fix the two problems that "#5640" didn't address.

- It is expected to raise an exception `TypeError`, but it didn't before.

  ```console
  % bin/mruby -e 'p [**1]'
  [1]
  ```

- The variable `h` is expected to keep an empty hash, but it didn't before.

  ```console
  % bin/mruby -e 'h = {}; p(**h, a: 1, b: 2); p h'
  {:a=>1, :b=>2}
  {:a=>1, :b=>2}
  ```
2022-02-18 22:15:50 +09:00