Yukihiro "Matz" Matsumoto
6f044de578
AUTHORS: update. [ci skip]
2021-09-17 07:47:45 +09:00
Yukihiro "Matz" Matsumoto
f7063ccd1b
AUTHORS: update. [ci skip]
2021-09-16 20:24:29 +09:00
Yukihiro "Matz" Matsumoto
8619ba6a38
Use struct initializer instead of memset.
2021-09-15 13:02:15 +09:00
Yukihiro "Matz" Matsumoto
e5e7bd29ef
sprintf.c: width may have been INT_MAX.
...
Now `width` is limited to `INT16_MIN..INT16_MAX`.
2021-09-14 14:12:56 +09:00
Yukihiro "Matz" Matsumoto
6dbf49fdb4
parse.y: cons_free unused node (empty string node).
2021-09-13 12:20:11 +09:00
Yukihiro "Matz" Matsumoto
100eac3fec
parse.y: allow non-local variable access from hash value omission.
...
For example, `{p:}` (means `{p:p}`) and `{String:}` (`{String:String}`)
should be allowed like CRuby.
2021-09-13 12:15:10 +09:00
Yukihiro "Matz" Matsumoto
6c76926d05
parse.y: allow value omission in Hash literals introduced in Ruby3.1.
...
`{x:, y:}` now is a syntax sugar of `{x: x, y: y}`.
This fix also includes the update of #4815 fix.
2021-09-13 11:04:27 +09:00
Yukihiro "Matz" Matsumoto
31fc74f5a8
parse.y: fix nint (int to node) and intn (node to int).
2021-09-12 23:14:43 +09:00
Yukihiro "Matz" Matsumoto
9e86d204e5
parse.y: avoid adding zero length strings.
2021-09-12 07:58:57 +09:00
Yukihiro "Matz" Matsumoto
e1a865f272
codedump.c: avoid printing OP_EXT? prefix.
2021-09-11 11:00:11 +09:00
Yukihiro "Matz" Matsumoto
648a774ef6
ops.h: update OP_HASHADD description.
2021-09-10 19:11:56 +09:00
Yukihiro "Matz" Matsumoto
da749d870f
array.c: forgot to adjust tail position in mrb_ary_splice.
2021-09-10 17:34:40 +09:00
Yukihiro "Matz" Matsumoto
cd0ffd6f1c
codegen.c: fixed gen_setxv bug with taking assignment value; fix #5550
2021-09-10 15:39:24 +09:00
Yukihiro "Matz" Matsumoto
69da192eec
codegen.c: gen_move refactoring.
2021-09-10 15:38:51 +09:00
Yukihiro "Matz" Matsumoto
7df31d9451
mruby.h: remove acc from callinfo; add cci instead.
...
`acc` was used as an index of the receiver (if positive), or a flag for
methods implemented in C. We replace `regs[ci->acc]` by `ci[1].stack[0]`.
And renamed `acc` (originally meant accumulator position) to `cci`
(means callinfo for C implemented method).
2021-09-10 12:39:51 +09:00
Yukihiro "Matz" Matsumoto
3050630b69
vm.c, codedump.c: add IREP_TT_NFLAG assertions.
...
The pool specified by `OP_STRING` (and `OP_SYMBOL`) should represent a
string, so that `IREP_TT_NFLAG` should be zero.
2021-09-10 10:25:07 +09:00
Yukihiro "Matz" Matsumoto
28b5c30b96
ops.h: add OP_SYMBOL instruction.
...
It generates a symbol by interning from the pool string.
2021-09-10 10:23:28 +09:00
Yukihiro "Matz" Matsumoto
b34713304a
fixup! codegen.c: resurrect s->lastpc to reduce iseq scans.
2021-09-10 10:22:49 +09:00
Yukihiro "Matz" Matsumoto
5fbea87fe5
codegen.c: resurrect s->lastpc to reduce iseq scans.
...
When parsing scripts frequent scans could cost too much.
2021-09-10 10:15:55 +09:00
Yukihiro "Matz" Matsumoto
3693187beb
vm.c: ci->acc (int16_t) may overflow.
2021-09-10 10:15:32 +09:00
Yukihiro "Matz" Matsumoto
c0f39bcaaf
Merge pull request #5549 from mruby/dependabot/github_actions/github/super-linter-4.7.3
...
build(deps): bump github/super-linter from 4.7.2 to 4.7.3
2021-09-10 10:15:20 +09:00
dependabot[bot]
a7e85bb7e9
build(deps): bump github/super-linter from 4.7.2 to 4.7.3
...
Bumps [github/super-linter](https://github.com/github/super-linter ) from 4.7.2 to 4.7.3.
- [Release notes](https://github.com/github/super-linter/releases )
- [Changelog](https://github.com/github/super-linter/blob/master/docs/release-process.md )
- [Commits](https://github.com/github/super-linter/compare/v4.7.2...v4.7.3 )
---
updated-dependencies:
- dependency-name: github/super-linter
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com >
2021-09-09 14:04:06 +00:00
Yukihiro "Matz" Matsumoto
7e612b1c89
string.c: check integer overflow in str_replace_partial.
2021-09-09 19:12:59 +09:00
Yukihiro "Matz" Matsumoto
8a41d2b876
string.c: check integer overflow in mrb_str_aset().
2021-09-09 19:12:36 +09:00
Yukihiro "Matz" Matsumoto
5777e33c2a
doc/guides/mrbconf.rb: add RO_DATA configuration description; #5547
2021-09-09 16:20:29 +09:00
Yukihiro "Matz" Matsumoto
49602f636d
value.h: add configuration macros around mrb_ro_data_p(); close #5547
...
- `MRB_USE_ETEXT_RO_DATA_P`: use `etext` and `edata`
- `MRB_NO_DEFAULT_RO_DATA_P`: not use the default `mrb_ro_data_p()`
2021-09-09 16:15:25 +09:00
Yukihiro "Matz" Matsumoto
5dd8b04d91
load.c: no need for conditional compilation; #5547
...
`mrb_ro_data_p()` is available anyway.
2021-09-09 11:07:19 +09:00
Yukihiro "Matz" Matsumoto
a503484cb3
value.h: use etext and edata which are more widely available; #5547
2021-09-09 10:12:50 +09:00
Yukihiro "Matz" Matsumoto
a3fe04eda2
Merge pull request #5548 from mruby/dependabot/github_actions/github/super-linter-4.7.2
...
build(deps): bump github/super-linter from 4.7.1 to 4.7.2
2021-09-09 07:34:02 +09:00
dependabot[bot]
ddf2a49622
build(deps): bump github/super-linter from 4.7.1 to 4.7.2
...
Bumps [github/super-linter](https://github.com/github/super-linter ) from 4.7.1 to 4.7.2.
- [Release notes](https://github.com/github/super-linter/releases )
- [Changelog](https://github.com/github/super-linter/blob/master/docs/release-process.md )
- [Commits](https://github.com/github/super-linter/compare/v4.7.1...v4.7.2 )
---
updated-dependencies:
- dependency-name: github/super-linter
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com >
2021-09-08 14:04:32 +00:00
Yukihiro "Matz" Matsumoto
e4a0728b24
array.c: refactor mrb_ary_splice.
2021-09-08 07:33:08 +09:00
Yukihiro "Matz" Matsumoto
1d1a89874f
value.h: fixed address comparison on macOS.
2021-09-07 18:51:04 +09:00
Yukihiro "Matz" Matsumoto
cbfaa5e20f
object.c: rename mrb_to_int to mrb_to_integer.
...
Consistent naming: `integer` to represent integer packed in `mrb_value`
instead of `int`.
2021-09-07 14:31:56 +09:00
Yukihiro "Matz" Matsumoto
79bc8e2539
string.h: rename mrb_str_to_inum to mrb_str_to_integer.
...
Consistent naming: `integer` to represent integer packed in `mrb_value`
instead of `inum`.
2021-09-07 14:31:56 +09:00
Yukihiro "Matz" Matsumoto
674d841ead
eval.c: if the parser raises an exception without an error message
...
`eval` would have crashed in formatting.
2021-09-07 07:37:19 +09:00
Yukihiro "Matz" Matsumoto
711f06a562
eval.c: check length of the file name.
...
It should be lexx than `UINT16_MAX`. If you don't check here, the parser
would raise an exception.
2021-09-07 07:35:35 +09:00
Yukihiro "Matz" Matsumoto
6fc6880f1f
codegen.c: improve exception handling in generate_code.
...
- remove `mrb_jmpbuf` from `codegen_scope`
- unify exception handling of `mrb_state` and `codegen_scope`
2021-09-07 07:33:28 +09:00
Yukihiro "Matz" Matsumoto
2fb06aabe6
parse.y: refactor mrb_parser_parse().
...
- remove `mrb_jmpbuf` from `truct mrb_parser_state`
- unify exception handling of `mrb_state` and `mrb_parser_state`.
2021-09-07 07:31:21 +09:00
Yukihiro "Matz" Matsumoto
ad3404229f
parse.y: refactoring mrb_parser_parser().
2021-09-06 13:58:01 +09:00
Yukihiro "Matz" Matsumoto
fc1f7c4bf0
numeric.c: shortcut overflowing operation when ndigit is too small.
2021-09-06 10:21:42 +09:00
Yukihiro "Matz" Matsumoto
ab3db07752
boxing_word.h: avoid mrb_float_p() when MRB_NO_FLOAT is on; fix #5546
2021-09-05 20:59:49 +09:00
Yukihiro "Matz" Matsumoto
43abf36f00
array.c: check integer overflow before addition.
2021-09-05 16:41:08 +09:00
Yukihiro "Matz" Matsumoto
7552b9322a
codegen.c: avoid integer overflow.
2021-09-05 09:25:44 +09:00
Yukihiro "Matz" Matsumoto
28c4f2f683
kernel.c: add __method__; ref #4468
2021-09-04 17:57:35 +09:00
Yukihiro "Matz" Matsumoto
09f686cd7b
Merge branch 'shuujii-rename-Kernel-__method__-to-Kernel-__callee__'
2021-09-04 16:18:20 +09:00
KOBAYASHI Shuji
8a9f891fd3
Rename Kernel#__method__ to Kernel#__callee__
...
Because the current behavior of `__method__` is equivalent to `__callee__`.
Example:
# example.rb
def src
__send__(ARGV[0])
end
alias dst src
%w[src dst].each {|n| puts "call #{n} => #{__send__(n).inspect}"}
Ruby:
$ ruby example.rb __method__
call src => :src
call dst => :src
$ ruby example.rb __callee__
call src => :src
call dst => :dst
mruby:
$ mruby example.rb __method__
call src => :src
call dst => :dst
2021-09-04 16:17:06 +09:00
Yukihiro "Matz" Matsumoto
2d8f4fa92f
proc.c: need to preserve target_class in callinfo.
...
Otherwise `target_class` can be lost when it differs from `proc`'s
`target_class`, e.g. when called from `instance_eval`.
Also we should not pass `target_class` to `MRB_OBJ_ALLOC` since it
checks instance type from the class, and `target_class` may not have
proper information. ref #5272
2021-09-04 13:50:32 +09:00
Yukihiro "Matz" Matsumoto
5acf7e7cf7
vm.c: remove duplicated calls of mrb_vm_ci_target_class().
2021-09-04 12:54:04 +09:00
Yukihiro "Matz" Matsumoto
e02350dd02
range.c: len = b - a may overflow.
2021-09-03 16:30:42 +09:00
Yukihiro "Matz" Matsumoto
dc4b60291a
range.c: hide internal `__num_to_a' method from backtrace.
2021-09-03 16:30:42 +09:00