Commit Graph

16139 Commits

Author SHA1 Message Date
Hoshiumi Arata da54da1923 Fix mrb_ro_data_p on Intel Mac 2024-08-13 17:27:08 +09:00
Yukihiro "Matz" Matsumoto 1e503f902d Merge pull request #6321 from dearblue/lib-warnings 2024-08-13 11:48:21 +09:00
Yukihiro "Matz" Matsumoto c853dc4090 vm.c (funcall): move va_list declaration right before va_start() 2024-08-12 22:57:05 +09:00
dearblue 79f4a67268 Avoid warnings in lib/**/*.rb
```console
% find -s lib -type f -name '*.rb' -exec ruby -cw {} \;
lib/mruby/build/command.rb:320: warning: `+' after local variable or literal is interpreted as binary operator
lib/mruby/build/command.rb:320: warning: even though it seems like unary operator
Syntax OK
Syntax OK
Syntax OK
Syntax OK
Syntax OK
lib/mruby/gem.rb:469: warning: `&' interpreted as argument prefix
Syntax OK
Syntax OK
Syntax OK
Syntax OK
```
2024-08-12 21:06:31 +09:00
Yukihiro "Matz" Matsumoto 22eb7e87af vm.c (uvenv): move declaration to initialization 2024-08-11 23:45:40 +09:00
Yukihiro "Matz" Matsumoto 7ca60a0964 vm.c (stack_extend_alloc): move variable declaration to initialization 2024-08-10 21:57:51 +09:00
Yukihiro "Matz" Matsumoto 56a82009aa Revert "The lex_state after literals should be EXPR_ENDARG."; fix #6298
This reverts commit e98823f189.
2024-08-10 19:17:49 +09:00
Yukihiro "Matz" Matsumoto a267dfd76b vm.c (OP_CLASS,OP_MODULE): combine declarations with initializers 2024-08-08 06:11:52 +09:00
Yukihiro "Matz" Matsumoto 22ec76f46c vm.c (OP_RANGE_INC): remove unnecessary local variable 2024-08-08 06:10:35 +09:00
Yukihiro "Matz" Matsumoto 320c757186 Merge pull request #6318 from dearblue/shrink-vm-vars
Shrink variables in `mrb_vm_exec()`
2024-08-06 12:21:36 +09:00
Yukihiro "Matz" Matsumoto aad2aacf25 range.c (mrb_get_values_at): support bigint too 2024-08-05 16:35:41 +09:00
Yukihiro "Matz" Matsumoto 6da2e60edc mruby-bigint (mpz_get_str): avoid malloc when base is a power of 2 2024-08-05 10:43:47 +09:00
Yukihiro "Matz" Matsumoto 0e6ef15b0f AUTHORS: update entries [ci skip] 2024-08-04 23:19:25 +09:00
Yukihiro "Matz" Matsumoto e8bb03da40 numeric.rb (step): iterate over integers even if end is a float
It used to check all `start`, `end` and `step`. If either of them are
float number, `#step` iterated over float number. Now we don't check the
type of `end` argument.
2024-08-03 13:35:09 +09:00
Yukihiro "Matz" Matsumoto 6d6e26661d gc.c: remove unnecessary argument from add_gray_list() 2024-08-02 21:14:58 +09:00
Yukihiro "Matz" Matsumoto 3324773f56 gc.c (mrb_gc_register): protect obj from GC during execution
Because `mrb_ary_new()` and `mrb_ary_push()` can cause GC; fix #6317
2024-08-02 04:52:11 +09:00
Yukihiro "Matz" Matsumoto 16fe4b2701 Merge pull request #6319 from mruby/dependabot/github_actions/super-linter/super-linter-6.8.0 2024-08-02 04:47:42 +09:00
dependabot[bot] 7db4cfd5cd build(deps): bump super-linter/super-linter from 6.7.0 to 6.8.0
Bumps [super-linter/super-linter](https://github.com/super-linter/super-linter) from 6.7.0 to 6.8.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.7.0...v6.8.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-08-01 14:32:11 +00:00
Yukihiro "Matz" Matsumoto aa06432776 mruby-array-ext: index should be within mrb_int range
Type check is done by `__to_int` method.
2024-08-01 07:34:20 +09:00
dearblue 822e3fdfd7 Remove pool and syms variables in mrb_vm_exec()
Can be referenced by traversing through the `irep` pointer.
2024-07-31 22:27:04 +09:00
dearblue f2a139a616 Avoid assignments to pc and proc parameters in mrb_vm_exec()
Introduce the `ci` variable instead and refer to it indirectly.
2024-07-31 22:27:04 +09:00
Yukihiro "Matz" Matsumoto a668e6d81e Merge pull request #6310 from dearblue/ci-extend 2024-07-31 11:09:23 +09:00
Yukihiro "Matz" Matsumoto eca59ad9ac Merge pull request #6312 from dearblue/OP_RETURN 2024-07-30 12:04:01 +09:00
Yukihiro "Matz" Matsumoto 3c5baac5c5 mruby-sprintf: fix a bug with negative octals
Leading octal digit may be 1, 3, 7 unlike binary or hexadecimal.
2024-07-30 11:33:18 +09:00
Yukihiro "Matz" Matsumoto ab95e042ca mruby-bigint (mrb_bint_xor): add fast path with fixnums 2024-07-29 16:44:54 +09:00
Yukihiro "Matz" Matsumoto b706c89c41 mruby-bigint (mrb_bint_2comp): fix assertion 2024-07-29 16:44:54 +09:00
Yukihiro "Matz" Matsumoto bf7f14341d mruby-bigint (mrb_bint_or): add fast path with fixnums 2024-07-29 15:47:19 +09:00
Yukihiro "Matz" Matsumoto dcf7adeeb7 mruby-bigint: use zero_p() 2024-07-29 15:43:22 +09:00
Yukihiro "Matz" Matsumoto 196c2bd0b9 mruby-bigint (mrb_bint_add): add type cast to stop warnings in C++ 2024-07-28 23:29:54 +09:00
Yukihiro "Matz" Matsumoto 081cd0627f mruby-bigint (mrb_bint_hash): need to get hash from all digits 2024-07-27 18:54:50 +09:00
Yukihiro "Matz" Matsumoto 203a89a3f2 mruby-bigint (zero_p): define a new predicate to check if mpz_t is 0 2024-07-27 18:54:50 +09:00
Yukihiro "Matz" Matsumoto 234a2b10fb mruby-bigint (mpz_neg): no need to check x != y 2024-07-27 18:54:50 +09:00
Yukihiro "Matz" Matsumoto 811637e99f mruby-bigint (mrb_bint_2comp): inline mpz_2comp 2024-07-27 18:54:49 +09:00
Yukihiro "Matz" Matsumoto c218894af9 mruby-bigint: use mp_limb instead of uint32_t
Because mp_limb may be uint16_t on some platforms.
2024-07-27 18:54:48 +09:00
Yukihiro "Matz" Matsumoto a50a2ce148 .gitingore: add entries (.cache, gmon.out, perf.data) 2024-07-27 18:53:55 +09:00
Yukihiro "Matz" Matsumoto 2247e4f355 mruby-bigint (mpz_xor): simplify the code 2024-07-27 18:53:36 +09:00
Yukihiro "Matz" Matsumoto b573a8430f mruby-bigint (mpz_or): simplify the code 2024-07-27 18:50:09 +09:00
Yukihiro "Matz" Matsumoto dea1cc18a6 mruby-bigint (mpz_and): simplify the code 2024-07-27 18:48:01 +09:00
Yukihiro "Matz" Matsumoto bf081c3d3d mruby-bigint (mrb_bint_and): further optimization for bint & int 2024-07-25 17:46:36 +09:00
Yukihiro "Matz" Matsumoto 99c078bb6b mruby-bigint (mrb_bint_2comp): simplify using mpz_2comp() 2024-07-25 16:18:49 +09:00
Yukihiro "Matz" Matsumoto 3d69412ea5 mruby-bigint: Distinguish uzero_p(x) and x->sn == 0
The latter is a check for integers that have been set up (and disclosed to the
outer world), while the former is a check for integers that are being worked on.
2024-07-25 16:18:48 +09:00
Yukihiro "Matz" Matsumoto 93653dfd4c mruby-bigint (uzero_p): add fast path 2024-07-25 16:18:48 +09:00
Yukihiro "Matz" Matsumoto 4ee7c8e021 mruby-bigint: rename uzero to uzero_p
Since uzero() is a predicate, and zero() is a function to assign zero to
mpz_t, it's confusion. Rename predicate uzero() to uzero_p() to follow
mruby naming convention.
2024-07-25 16:18:48 +09:00
Yukihiro "Matz" Matsumoto 88536ebe30 mruby-bigint (mpz_xor): support bit-wise xor with negative numbers; #6314 2024-07-25 16:18:48 +09:00
Yukihiro "Matz" Matsumoto ee2eb6c87e mruby-bigint (mpz_or): support bit-wise or with negative numbers; #6314 2024-07-25 16:18:48 +09:00
Yukihiro "Matz" Matsumoto 69a80c94b9 mruby-bigint (mpz_and): support bit-wise and with negative numbers
Negative integers are virtually considered as 2's compliment of the
absolute value of the corresponding number. It means `-1` is considered
as infinite sequence of `1` toward msb side. ref #6314
2024-07-25 16:18:48 +09:00
Yukihiro "Matz" Matsumoto e3a459d5b9 mruby-bigint (mrb_bint_and): optimize bint & fixnum operation; ref #6314 2024-07-25 16:18:48 +09:00
Yukihiro "Matz" Matsumoto c16aba9280 mruby-bigint: remove special handling of Float in bitwise operations
CRuby raises TypeError with float numbers as operands; ref #6314
2024-07-25 16:18:47 +09:00
Yukihiro "Matz" Matsumoto 81a9eef591 Merge pull request #6313 from hoshiumiarata/fix_typo_in_opcode_doc 2024-07-24 12:28:52 +09:00
Yukihiro "Matz" Matsumoto b4ffddebdf Merge pull request #6314 from hoshiumiarata/optimize_int_even 2024-07-24 08:11:43 +09:00