Commit Graph

9367 Commits

Author SHA1 Message Date
take-cheeze e050cfb349 Add forgotten mkdir_ps. 2018-06-20 18:20:26 +09:00
Yukihiro "Matz" Matsumoto 5e7ced0785 Merge pull request #4047 from kou/stop-to-use-freed-value
Stop to use freed value
2018-06-19 19:33:37 +09:00
Yukihiro "Matz" Matsumoto 47413d0507 Merge pull request #4046 from kou/fix-wrong-free-function
Fix wrong free function
2018-06-19 19:32:18 +09:00
Kouhei Sutou 33c8c8f8a6 Stop to use freed value 2018-06-19 17:27:34 +09:00
Kouhei Sutou fb9358206e Fix wrong free function
mrb_locale_free() should be used for the return value of
mrb_locale_from_utf8().
2018-06-19 17:25:38 +09:00
Yukihiro "Matz" Matsumoto a9abf65f03 Fixed wrong usages of mrb_raisef(); ref #4043
`mrb_raisef()` only takes `%S` specifier. If you don't have extra
arguments, use `mrb_raise()`.
2018-06-15 07:47:18 +09:00
Yukihiro "Matz" Matsumoto 70600c3ba8 Resolve sign comparison warning; ref #4044 2018-06-14 14:16:04 +09:00
Tomoyuki Sahara 5340d39ed4 Merge pull request #4044 from iij/fixes-from-iij-socket
incorporate fixes from iij/socket
2018-06-14 13:58:48 +09:00
Tomoyuki Sahara af8020e7fd sa_family_t is not defined on windows. 2018-06-14 13:52:37 +09:00
Tomoyuki Sahara 2eeac91098 set sockaddr_un.sun_len on the systems that have sockaddr.sa_len.
If your system has sa_len but is not BSD-derived, define HAVE_SA_LEN=1
on mrbgem.rake or build_config.rb.
2018-06-14 13:36:01 +09:00
Tomoyuki Sahara 5013d2b20f struct sockaddr_un can be truncated.
When we have "struct sockaddr_un *s_un", we could not assume *s_un
points to a memory region which size is at least sizeof(*s_un).
Even worse, it may be shorter than sizeof(struct sockaddr) on some
systems.
2018-06-14 13:28:32 +09:00
Tomoyuki Sahara 3618556a95 struct sockaddr_un can be shorter than struct sockaddr.
ref: https://github.com/iij/mruby-socket/issues/45
2018-06-14 13:25:57 +09:00
Yukihiro "Matz" Matsumoto 97933665b6 Restore GC arena after raised exceptions; ref #4042 2018-06-14 11:42:34 +09:00
Yukihiro "Matz" Matsumoto ba090a46af Need to add a write barrier for ranges; fix #4042
Ranges are almost immutable but `initialize` and `initialize_copy`
modify the receiver so that we need to add a write barrier.
2018-06-14 11:25:12 +09:00
Yukihiro "Matz" Matsumoto a7f77fefa9 Check for switching to uninitialized fiber; fix #4041
The problem was caused by `Fiber.current.resume'.
2018-06-14 11:15:49 +09:00
Yukihiro "Matz" Matsumoto 896de5532b Merge pull request #4043 from take-cheeze/fix_test_dep
Fix unnecessary rebuild of tests.
2018-06-14 10:13:35 +09:00
take-cheeze f715f2ddea Fix unnecessary rebuild of tests. 2018-06-13 23:32:08 +09:00
Yukihiro "Matz" Matsumoto 23a4e7149d Revert "No longer need to insert write barriers for fibers."
This reverts commit c6736357a7.
The assumption was wrong and caused the issue; fix #4020
2018-06-11 14:50:42 +09:00
Yukihiro "Matz" Matsumoto a9b740b36b Retrieve b operand from the instruction (for debugging); ref #4020 2018-06-11 14:50:03 +09:00
Yukihiro "Matz" Matsumoto faa4eaf680 mrb_class_real() did not work for BasicObject; fix #4037 2018-06-08 14:13:06 +09:00
Yukihiro "Matz" Matsumoto 55edae0226 Allow Object#clone to copy frozen status only; fix #4036
Copying all flags from the original object may overwrite the clone's
flags e.g. the embedded flag.
2018-06-07 16:17:00 +09:00
Yukihiro "Matz" Matsumoto cfd0c93d7d Merge pull request #4035 from katzer/patch-1
[mruby-socket] Declare inet_ntop and inet_pton as static
2018-06-07 16:03:14 +09:00
Yukihiro "Matz" Matsumoto 55dcdd26cc Merge pull request #4039 from i110/i110/fix-broken-lexical-variables
fix broken lexical variables
2018-06-07 16:02:30 +09:00
Yukihiro "Matz" Matsumoto 778500563a Extend stack when pushing arguments that does not fit in; fix #4038 2018-06-07 15:59:00 +09:00
Yukihiro "Matz" Matsumoto ff0a4f7867 Export stack_extend function (renamed mrb_stack_extend); fix #3219
This change is required to support #4038.
2018-06-07 15:55:20 +09:00
Ichito Nagata 1dbeda5c9c add test for eval 2018-06-06 15:35:41 +09:00
Ichito Nagata c2b2bec9e2 Revert "Fix heap use after free on mruby-aws-sigv4."
This reverts commit b8869498b7.
2018-06-06 15:04:58 +09:00
Sebastián Katzer e7a4699135 Declare inet_ntop and inet_pton as static
To avoid conflicts with multiple definitions of inet_ntop and inet_pton if compiled with # define _WIN32_WINNT _WIN32_WINNT_VISTA

C:/mingw-w64/x86_64-7.2.0-posix-seh-rt_v5-rev1/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/../../../../x86_64-w64-mingw32/lib/../lib/libWs2_32.a(dghfs00169.o):(.text+0x0): multiple definition of `inet_pton'
722C:/projects/iss/mruby/build/host/lib/libmruby.a(socket.o):C:/projects/iss/mruby/mrbgems/mruby-socket/src/socket.c:80: first defined here

define _WIN32_WINNT _WIN32_WINNT_VISTA
2018-06-05 15:59:12 +02:00
Yukihiro "Matz" Matsumoto aa5c5de4fd Merge pull request #4033 from i110/i110/fix-envadjust
fix env->stack misadjusting: fix #4029
2018-06-03 20:54:12 +09:00
Ichito Nagata edaa7a1ba1 fix env->stack misadjusting 2018-06-03 19:40:33 +09:00
Yukihiro "Matz" Matsumoto 395260747a Instead of defining Hash#dup, we should define Hash#initialize_copy.
`Hash#clone` did not work properly; fix #4030
2018-06-01 22:40:42 +09:00
Yukihiro "Matz" Matsumoto f408143c28 The clone method should copy object status (e.g. frozen) too; #4030 2018-06-01 22:39:40 +09:00
Yukihiro "Matz" Matsumoto 7ed164ba89 Merge pull request #4031 from i110/i110/hash_default
let Hash#merge keep ifnone value
2018-06-01 20:29:45 +09:00
Ichito Nagata 4a2b055cdd let Hash#merge keep ifnone value 2018-06-01 12:48:17 +09:00
Yukihiro "Matz" Matsumoto b64ce17852 Should not call initialize_copy for TT_ICLASS; fix #4027
Since `TT_ICLASS` is a internal object that should never be revealed
to Ruby world.
2018-05-30 17:05:40 +09:00
Yukihiro "Matz" Matsumoto 1dddc2f712 Clear __classname__ of duped class/module; ref #4027 2018-05-30 17:05:05 +09:00
Yukihiro "Matz" Matsumoto 14c21793a0 Check if the exception is frozen; fix #4025
`exc_debug_info()` and `mrb_keep_backtrace()` raise `FrozenError`
if the exception is frozen and lead to infinite loop.
2018-05-23 08:30:50 +09:00
Yukihiro "Matz" Matsumoto c8fb7453fc Add then alias to yield_self.
`then' was added in CRuby 2.6.
2018-05-23 08:30:50 +09:00
Yukihiro "Matz" Matsumoto a7c8575fe3 Merge pull request #4023 from iwamatsu/fix-upstream
Fix test of mruby-pack with big-endian CPUs
2018-05-11 10:34:01 +09:00
Nobuhiro Iwamatsu 0759647f06 Fix test of mruby-pack with big-endian CPUs
When running the mruby-pack test with big endian, test data is incorrect,
so it will fail with "i" and "I".

------
Fail: pack/unpack "i" (mrbgems: mruby-pack)
 - Assertion[1] Failed: Expected to be equal
    Expected: "\xff\xff\xc7\xcf"
      Actual: "\xff\xff\xcf\xc7"
 - Assertion[2] Failed: Expected to be equal
    Expected: [-12345]
      Actual: [-14385]
Fail: pack/unpack "I" (mrbgems: mruby-pack)
 - Assertion[1] Failed: Expected to be equal
    Expected: "\x00\x0090"
      Actual: "\x00\x0009"
 - Assertion[2] Failed: Expected to be equal
    Expected: [12345]
      Actual: [14640]
------

This will fix the test data at big-endian.

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
2018-05-10 12:54:08 +09:00
Yukihiro "Matz" Matsumoto bda88bdbea Merge pull request #4022 from mimaki/mruby-r-option
Add `-r` option for `mruby` and `mirb`. (mrbgem is not supported)
2018-05-09 18:31:34 +08:00
Hiroshi Mimaki e76492c776 Fix CI build errors and warnings. 2018-05-08 09:55:09 +09:00
Hiroshi Mimaki d973a8ebc4 Add -r option for mruby and mirb. 2018-05-07 18:17:50 +09:00
Yukihiro "Matz" Matsumoto fc247449e2 Merge pull request #4017 from mimaki/mruby-d-option
Add `-d` option for `mruby` and `mirb`.
2018-05-07 14:31:19 +08:00
Hiroshi Mimaki 0c01afc3c9 Fix CI build errors and warnings. 2018-05-07 12:23:32 +09:00
Yukihiro "Matz" Matsumoto 72581696d3 env referred from top-level callinfo should not be unshared; fix #4019
Because `mirb` keeps top-level environment across each iteration.
2018-05-03 15:15:30 +09:00
Yukihiro "Matz" Matsumoto 2d4c092de7 Need to call mrb_str_modify() in mrb_str_cat_str(); fix #4018
If `str` and `str2` are the same string object `str->ptr` may be
rewritten by `mrb_str_modify()`.
2018-05-02 22:50:55 +09:00
Hiroshi Mimaki 1d16646506 Add -d option for mruby and mirb. 2018-05-02 20:52:02 +09:00
Yukihiro "Matz" Matsumoto 028e34d345 Update MRB_FLO_TO_STR_FMT to "%.16g"; fix #4016 2018-05-01 17:21:01 +09:00
Yukihiro "Matz" Matsumoto 2a38eb9325 Check the return value from mrb_get_datatype(); fix #4009
The return value (void*) may be NULL. Avoid using `mrb_get_datatype()`
directly and use `io_get_open_fptr()` instead.
2018-05-01 13:29:08 +09:00