Commit Graph

12364 Commits

Author SHA1 Message Date
dearblue 04a4e59c83 Fix build error for mruby-bin-debugger
This is a missing change in #5272.

This issue was reported by @shuujii.
https://github.com/mruby/mruby/pull/5272#issuecomment-761819737
2021-01-18 00:00:53 +09:00
Yukihiro "Matz" Matsumoto f4a3dc4f07 Add tests for Integer#quo and Float#quo; #5268 2021-01-17 23:02:36 +09:00
Yukihiro "Matz" Matsumoto 12ff88563d Fix int_quo to do float division; fix #5268 2021-01-17 23:02:36 +09:00
Yukihiro "Matz" Matsumoto c7452ff61f Define Rational#quo; fix #5268 2021-01-17 23:02:35 +09:00
Yukihiro "Matz" Matsumoto b4817a54f0 Make mrb_to_flo() to convert objects, not integer, not float; #5268
Thinking `Ratinal` and `Complex` in mind.
2021-01-17 23:02:35 +09:00
Yukihiro "Matz" Matsumoto 126f0f0563 Merge pull request #5292 from dearblue/objspace-memsize
Fix NULL pointer dereference with mruby-os-memsize and mruby-method
2021-01-16 17:55:43 +09:00
dearblue 0fdf5d9bb9 Fix NULL pointer dereference with mruby-os-memsize and mruby-method
If it gets an insubstantial method object with `obj.method`, it will raise a `SIGSEGV` with `ObjectSpace.memsize_of(method)`.
2021-01-16 15:52:52 +09:00
Yukihiro "Matz" Matsumoto 0aa8db9a06 Merge pull request #5291 from dearblue/fix-5272
Fixed stack position of return value; ref #5272
2021-01-16 13:56:26 +09:00
dearblue 414a61a9d2 Fixed stack position of return value; ref #5272
When I `#call` the "proc" object created by the `mrb_proc_new_cfunc()` function from Ruby space, the return value did not go into the correct stack position.
This can destroy the calling variable.

This issue is now caused by #5272. sorry.
2021-01-16 11:05:15 +09:00
Yukihiro "Matz" Matsumoto 4bba769b95 Avoid syntax error regarding colons in the expression; fix #5290
Reported and inspired by @hasumikin; based on CRuby's `parse.y`.
2021-01-15 22:49:40 +09:00
Yukihiro "Matz" Matsumoto 28d5dabacd Merge pull request #5273 from dearblue/fiber
Capture the return value of `Fiber.yield` via C; ref #5261
2021-01-14 23:47:25 +09:00
Yukihiro "Matz" Matsumoto a639a39883 Rational denominator should not be zero. 2021-01-13 09:17:20 +09:00
dearblue 0229446a30 Capture the return value of Fiber.yield via C; ref #5261 2021-01-12 23:04:36 +09:00
Yukihiro "Matz" Matsumoto c7d96dbf84 Merge pull request #5289 from dearblue/sockaddr_un
Initialize all area of `struct sockaddr_un`
2021-01-12 22:22:44 +09:00
Yukihiro "Matz" Matsumoto 9d950818ce Merge branch 'dearblue-reorganize-ci' 2021-01-12 22:14:53 +09:00
dearblue 8928bc2dce Initialize all area of struct sockaddr_un
Members of `struct sockaddr_un` are requesting the definitions of `sun_family` and `sun_path`.
https://pubs.opengroup.org/onlinepubs/009696699/basedefs/sys/un.h.html

But the other members are optional and environment dependent.

In fact, other members are defined in the BSD series.
from NetBSD-9.1 <https://github.com/NetBSD/src/blob/da504f75982b244b2288bc9970bbc203bd77a9c1/sys/sys/un.h#L49-L53>

```c
struct  sockaddr_un {
        unsigned char   sun_len;        /* sockaddr len excluding NUL */
        sa_family_t     sun_family;     /* AF_UNIX */
        char    sun_path[104];          /* path name (gag) */
};
```
2021-01-12 21:35:18 +09:00
Yukihiro "Matz" Matsumoto bec4d30dc6 Merge branch 'reorganize-ci' of https://github.com/dearblue/mruby into dearblue-reorganize-ci 2021-01-12 18:38:42 +09:00
Yukihiro "Matz" Matsumoto e13f34e308 Merge pull request #5288 from shuujii/fix-that-sometimes-parallel-build-of-test-code-fails
Fix that sometimes parallel build of test code fails; fix #5284
2021-01-12 16:29:02 +09:00
Yukihiro "Matz" Matsumoto b64ec814d6 Fix a signed shift bug on 32 bit platforms; ref e1c9e7e 2021-01-12 16:26:05 +09:00
Yukihiro "Matz" Matsumoto 1310368b3f Silence Windows warnings (cast and setmode). 2021-01-12 16:25:30 +09:00
KOBAYASHI Shuji 02121cbd65 Fix that sometimes parallel build of test code fails; fix #5284
The cause is that `mrbgem.rake` of` mruby-test` gem is loaded when test
code is requested to be built, but when `mrbgem.rake` is loaded,
`MRuby::Gem.current` is updated, which is not thread safe.

Address this by not loading `mrbgem.rake` in parallel.
2021-01-12 15:41:22 +09:00
Yukihiro "Matz" Matsumoto a8b8d316ab Save NOARG information in struct mt_elem; fix #5257 2021-01-12 14:51:34 +09:00
Yukihiro "Matz" Matsumoto e1c9e7efab Changed packing format of inline symbols.
To make inline symbols packed in 30 bits.
2021-01-12 14:51:33 +09:00
Yukihiro "Matz" Matsumoto 974e245ae0 Merge pull request #5285 from dearblue/io-unimps
Remove functions for unimplemented methods
2021-01-11 23:49:54 +09:00
Yukihiro "Matz" Matsumoto cdbcade041 Merge pull request #5286 from dearblue/io-popen
Integrate the argument parsing part of `IO.popen`
2021-01-11 23:48:41 +09:00
dearblue 0c96c4c34a Integrate the argument parsing part of IO.popen 2021-01-11 23:07:25 +09:00
dearblue 01897f8456 Remove functions for unimplemented methods
- Use `mrb_notimplement_m()` instead.
- Hide the unused `option_to_fd()` when `TARGET_OS_IPHONE` is enabled.
2021-01-11 23:01:53 +09:00
Yukihiro "Matz" Matsumoto d531636584 Merge pull request #5283 from shuujii/add-missing-cast-in-ea_next_capa_for
Add missing cast in `ea_next_capa_for`
2021-01-11 21:17:44 +09:00
Yukihiro "Matz" Matsumoto f8b938435c Merge pull request #5282 from dearblue/mruby-config-cross
Create a `mruby-config` that can be run on the host by cross-building
2021-01-11 20:34:38 +09:00
KOBAYASHI Shuji 87ba84b048 Add missing cast in ea_next_capa_for 2021-01-11 20:19:55 +09:00
dearblue 66df8c619a Create a mruby-config that can be run on the host by cross-building
The output directory will be `host-bin`, so it will be output as `<build-dir>/host-bin/mruby-config`.

It's still not available for target devices.
2021-01-11 17:07:05 +09:00
Yukihiro "Matz" Matsumoto 672e016b13 Merge pull request #5281 from shuujii/remove-the-definition-of-mrb_uint-in-numeric.h-that-is-no-longer-needed
Remove the definition of `mrb_uint` in `numeric.h` that is no longer needed
2021-01-11 16:35:42 +09:00
Yukihiro "Matz" Matsumoto 9577e6ca6a Merge pull request #5280 from shuujii/remove-unneeded-check-to-mrbtest-in-tasks-presym.rake
Remove unneeded check to `mrbtest` in `tasks/presym.rake`
2021-01-11 16:34:05 +09:00
KOBAYASHI Shuji 48feda0692 Remove the definition of mrb_uint in numeric.h that is no longer needed 2021-01-11 16:20:27 +09:00
KOBAYASHI Shuji 123d15c5ab Remove unneeded check to mrbtest in tasks/presym.rake
With the change in #5267, `build.products` no longer contains `mrbtest` when
`tasks/presym.rake` is loaded.
2021-01-11 16:15:12 +09:00
Yukihiro "Matz" Matsumoto 0290f06681 Merge pull request #5279 from shuujii/remove-unneeded-mruby-test-gem-in-build_config-no-float.rb
Remove unneeded `mruby-test` gem in `build_config/no-float.rb` [ci skip]
2021-01-11 12:53:17 +09:00
KOBAYASHI Shuji 2ddd66cc4b Remove unneeded mruby-test gem in build_config/no-float.rb [ci skip]
Use `enable_test` to enable the test.
2021-01-11 12:07:08 +09:00
Yukihiro "Matz" Matsumoto ffea200075 Merge pull request #5278 from dearblue/annotation
Fix annotations [ci skip]
2021-01-11 11:57:09 +09:00
dearblue a0662a16a3 Fix annotations [ci skip] 2021-01-11 11:33:39 +09:00
Yukihiro "Matz" Matsumoto 3deb3a7aac Fix CI failure on Windows environment.
`1L` on Windows means `32 bit int`.
2021-01-10 22:52:41 +09:00
Yukihiro "Matz" Matsumoto e66c6edaba Fix mixture of inline int declaration in for statement. 2021-01-10 22:52:40 +09:00
Yukihiro "Matz" Matsumoto 80a7655b10 Merge pull request #5271 from shuujii/fix-build-error-in-cross-build-with-presym
Fix build error in cross-build with presym
2021-01-10 22:15:52 +09:00
Yukihiro "Matz" Matsumoto dc5ade3729 Merge pull request #5275 from dearblue/read_irep
Replace `tempirep` with `RProc`
2021-01-10 22:13:51 +09:00
Yukihiro "Matz" Matsumoto 596b542720 Merge pull request #5274 from shuujii/fix-the-condition-to-remove-mrbtest-when-rake-clean
Fix the condition to remove `mrbtest` when `rake clean`
2021-01-10 22:07:22 +09:00
dearblue 3fc848b545 Replace tempirep with RProc
Previously I used the `RData` object to avoid a memory leak in `mrb_irep` if `src/load.c` failed.
ref: https://github.com/mruby/mruby/pull/4250
commit: f1523d2404

Considering that the `RProc` object will be created in the subsequent process, it is preferable to create the `RProc` object from the beginning.
Along with this, the inside of `read_irep()` is replaced with the processing centered on the `RProc` object.

The global function that returns the `mrb_irep` pointer is still provided for compatibility.
2021-01-10 21:41:51 +09:00
Yukihiro "Matz" Matsumoto e8e28eacc7 Revert "Revert "Simplify full-core.gembox""
This reverts commit 37d795dec7.
This reapplies e20d652 (#4202), which is reverted, but its issue was solved
by 1d8456f.
2021-01-10 20:29:49 +09:00
KOBAYASHI Shuji fe28e8617e Fix the condition to remove mrbtest when rake clean 2021-01-10 16:28:14 +09:00
dearblue 9877f4ca3c Revert "Save&restore execution point (pc) in c->cibase->pc; fix #5261"
This reverts commit a0c1e075e3.

This is because the `mrb_callinfo::pc` has been reorganized, resulting in over-correction.
2021-01-10 13:33:17 +09:00
dearblue ced89c25ff Unified pc and err of mrb_callinfo
This enhances self-containment.

- Changed the `mrb_callinfo::pc` field to point to itself.
  Previously it indicated the return destination of the previous call level.
  `mrb_callinfo::pc` will now hold the address to its own `proc->body.irep->iseq`.
- Removed `mrb_callinfo::err` field.
  This is because `mrb_callinfo::pc - 1` is semantically the same as the previous `err`.
- The `pc0` and `pc_save` variables in `mrb_vm_exec()` are no longer needed and have been deleted.
- It removes the argument because `cipush()` doesn't need to save the previous `pc`.
2021-01-10 13:23:43 +09:00
dearblue 16baea0677 Changes stackent to stack of mrb_callinfo
This enhances self-containment.

Previously `mrb_context::stack` had the current call level stack, but now it owns it.
The `mrb_context::stack` field, which is no longer needed, will be removed.
2021-01-10 13:23:35 +09:00