Tomoyuki Sahara
ae4fc77675
Merge pull request #39 from jbreeden/master
...
Correct File::NULL for Windows
2015-04-18 06:50:32 +09:00
Jared Breeden
6d6be18d4e
Removing redundant platform check
2015-04-17 15:45:14 -04:00
Jared Breeden
7f8324a2ed
Merge branch 'master' of https://github.com/iij/mruby-io
2015-04-17 15:40:35 -04:00
Jared Breeden
36343cf098
Correct File::NULL for Windows
2015-04-17 15:39:11 -04:00
furunkel
08c877699a
Use builtins for overflow math if possible
2015-04-17 17:37:09 +02:00
Yukihiro "Matz" Matsumoto
e79afd4c74
Merge pull request #2765 from miura1729/original2
...
Fix to avoid warning
2015-04-17 23:49:31 +09:00
Miura Hideki
eb3af3752f
Fix to avoid warning
2015-04-17 20:04:07 +09:00
Yukihiro "Matz" Matsumoto
ee59f8b8b2
Merge pull request #2762 from miura1729/original
...
Add test of negative arguments for Integer#%
2015-04-17 17:49:29 +09:00
Miura Hideki
a21d3f627e
Add test of negative arguments for Integer#%
2015-04-17 17:26:12 +09:00
Jared Breeden
c0738a74c6
Excluding wait call for windows
2015-04-05 17:21:02 -04:00
Tomoyuki Sahara
cfbc8a8995
Merge pull request #38 from jbreeden/master
...
Excluding wait call for windows
2015-04-05 09:23:29 +09:00
Tomoyuki Sahara
e92fd76248
wait for child processes when we close pipes. fixes #37 .
2015-04-03 10:05:09 +09:00
Yukihiro "Matz" Matsumoto
fa824e324b
Merge pull request #2755 from Yuuhei-Okazaki/fix_maxbreakpoint_reference
...
fix maximum value of the index when access breakpoints.
2015-04-03 08:31:37 +09:00
Yukihiro "Matz" Matsumoto
d77249f006
Merge pull request #2754 from cremno/remove-unnecessary-inttypes.h-inclusion
...
remove unnecessary <inttypes.h> inclusion
2015-04-03 08:30:44 +09:00
Yukihiro "Matz" Matsumoto
cb3e1433a4
Merge pull request #2753 from cremno/vs2015-has-inline-kw
...
MSVC 2015 implements inline keyword
2015-04-02 23:07:31 +09:00
Yuhei Okazaki
06435f5bc7
fix maximum value of the index when access breakpoints.
2015-03-31 10:52:10 +09:00
cremno
18fdf7e03f
remove unnecessary <inttypes.h> inclusion
...
The format specifier macros were needed to portably print a mrb_int,
because mrb_raisef() originally called vsnprintf(). It doesn't anymore
since 18b2683b97 and the mrb_int format
specifier macros are already gone.
2015-03-30 21:01:16 +02:00
cremno
6424569a63
MSVC 2015 implements inline keyword
...
Apparently the C compiler of Visual Studio 2015 CTP6 finally implements
inline as inline and not only as _inline and __inline.
2015-03-30 20:13:23 +02:00
Yukihiro "Matz" Matsumoto
0573306f51
Merge pull request #2750 from cremno/call-c11-timespec_get
...
mruby-time: call ISO C11's timespec_get() if available
2015-03-23 14:11:19 +09:00
Yukihiro "Matz" Matsumoto
2249afce25
Merge pull request #2751 from cremno/refactor-write_pool_block
...
refactor write_pool_block()
2015-03-23 14:10:11 +09:00
cremno
7985f75dfa
refactor write_pool_block()
...
No need to write the same assertion in each case (except the default
one). Instead we can assert after the switch statement.
2015-03-22 23:10:38 +01:00
cremno
c47cc0c3bb
call C11's timespec_get()
...
gettimeofday() is an obsolescent POSIX function which may be removed in
a future version. POSIX recommends using clock_gettime() (also POSIX)
instead, but it isn't available on OS X or Windows (at least with MSVC
and older MinGW versions).
Whereas timespec_get() is part of ISO C11 and mruby uses some small
other C11 features too. It isn't universally available yet either, but
it might be in the future. And Visual C++ 2015 implements it! Since
mruby strives for ISO C and not POSIX compatibility, I think it's a
reasonable choice.
TIME_UTC is used instead of __STDC_VERSION__, because if TIME_UTC is
defined, then most likely timespec_get() is too. This isn't true in case
of __STDC_VERSION__ (see MSVC).
2015-03-22 22:52:12 +01:00
Yukihiro "Matz" Matsumoto
17b7745593
Merge branch 'master' of github.com:mruby/mruby
2015-03-21 11:20:52 +09:00
Yukihiro "Matz" Matsumoto
4cf9b2fd1c
execute ensure clause only when skipping call frame; fix #2726
2015-03-21 11:20:44 +09:00
Yukihiro "Matz" Matsumoto
dc757f70fd
Merge pull request #2747 from jbreeden/vcpp_exceptions
...
Fix exceptions for visualcpp
2015-03-20 00:28:46 +09:00
Jared Breeden
f6f70c86db
Fix exceptions for visualcpp
2015-03-18 20:14:54 -04:00
Yukihiro "Matz" Matsumoto
0e218f5356
Merge pull request #2746 from tarosay/tarosa
...
I modified the undefined frexpl in cygwin of make
2015-03-16 19:34:29 +09:00
Tarosa
52f35b83e2
I have added the #ifdef __CYGWIN32__ to modify the fmt_fp.c
2015-03-16 19:22:47 +09:00
Tarosa
f6dc516319
I modified the undefined frexpl in cygwin of make
2015-03-16 18:34:08 +09:00
Yukihiro "Matz" Matsumoto
f32393a820
Merge pull request #2740 from govm/stack_extend-in-mrb_f_send
...
Fix #2739 stack_extend in mrb_f_send
2015-03-06 00:22:58 +09:00
Go Saito
16b5986d14
stack_extend in mrb_f_send
...
mrb_f_send needs stack_extend like OP_SEND
Signed-off-by: Go Saito <gos@iij.ad.jp >
2015-03-05 17:41:34 +09:00
Yukihiro "Matz" Matsumoto
7d67c573d7
Merge pull request #2738 from kou/use-ptrdiff-t
...
Use ptrdiff_t to suppress signedness warning
2015-02-28 20:43:18 +09:00
Kouhei Sutou
42359d6241
Use ptrdiff_t to suppress signedness warning
...
3df3216179 says so but there is no warning
with GCC 4.9 on my Debian GNU/Linux environment.
2015-02-28 15:30:18 +09:00
Yukihiro "Matz" Matsumoto
414678d61a
Merge pull request #2736 from cremno/delete-prototypes-of-undefined-functions
...
delete prototypes of undefined functions
2015-02-27 17:15:59 +09:00
Yukihiro "Matz" Matsumoto
3cba701672
fix MSVC initialization issue by a patch from @dyama; close #2734
2015-02-27 17:14:32 +09:00
Yukihiro "Matz" Matsumoto
3df3216179
change size_t to ptrdiff_t to silence signedness warnings; #2732
2015-02-27 17:14:03 +09:00
cremno
893f937922
delete prototypes of undefined functions
2015-02-26 09:56:03 +01:00
Yukihiro "Matz" Matsumoto
a1d4992187
Merge pull request #2732 from kou/fix-a-crash-bug-on-raise-after-realloc
...
Fix a crash bug on raising after realloc
2015-02-26 14:40:02 +09:00
Kouhei Sutou
3fefe52ffb
Fix a crash bug on raising after realloc
...
The following program reproduces this problem:
#include <mruby.h>
static mrb_value
recursive(mrb_state *mrb, mrb_value self)
{
mrb_int n;
mrb_get_args(mrb, "i", &n);
if (n == 0) {
mrb_raise(mrb, E_RUNTIME_ERROR, "XXX");
} else {
mrb_funcall(mrb, self, "recursive", 1, mrb_fixnum_value(n - 1));
}
return self;
}
int
main(void)
{
mrb_state *mrb;
mrb = mrb_open();
mrb_define_method(mrb, mrb->kernel_module, "recursive", recursive,
MRB_ARGS_REQ(1));
mrb_funcall(mrb, mrb_top_self(mrb), "recursive", 1, mrb_fixnum_value(30));
mrb_close(mrb);
}
Recursive method call isn't required. It's just for expanding call info
stack.
If mrb_realloc() is called in cipush(), cibase address is changed. So,
we shouldn't compare ci before mrb_realloc() and cibase after
mrb_realloc(). It accesses unknown address and causes crash.
2015-02-25 00:13:40 +09:00
Yukihiro "Matz" Matsumoto
a2a272ca8e
Merge pull request #2730 from kou/fix-no-expression-case
...
Fix a bug that no expression case doesn't return valid value
2015-02-24 22:07:36 +09:00
Kouhei Sutou
4b4ddd5a28
Fix a bug that no expression case doesn't return valid value
...
Here is a script that reproduces this problem:
x = case
when true; 1
end
p x # => main # 1 is expected
2015-02-24 20:53:12 +09:00
Yukihiro "Matz" Matsumoto
68f60714dc
Merge pull request #2729 from kou/fix-if-and-no-value-returned-case
...
Fix a bug that if and no return value case can't return true clause value
2015-02-24 14:29:47 +09:00
Yukihiro "Matz" Matsumoto
d0bc006a73
Merge pull request #2728 from govm/fix-dereference-invalid-argv
...
fix pointer dereference after realloc
2015-02-24 14:28:14 +09:00
Kouhei Sutou
584d6de3c2
Fix a bug that if and no return value case can't return true clause value
...
Here is a script that reproduce this problem:
x = if true
1
else
case 2
when 3
end
4
end
p x # => nil # 1 is expected
2015-02-24 00:16:41 +09:00
Go Saito
42d23084b7
fix pointer dereference after realloc
...
In src/vm.c: mrb_funcall_with_block
stack_extend may realloc mrb->c->stbase, if argv points on mruby's stack,
then it points invalid address after stack_extend.
e.g. src/class.c: mrb_instance_new
This code:
```ruby
class A
def initialize(a0,a1,a2,a3,a4)
a0.is_a? Array
end
end
def f(a0,a1,a2,a3,a4)
A.new(a0,a1,a2,a3,a4)
f(a0,a1,a2,a3,a4)
end
f(0,1,2,3,4)
```
is expected to get exception
```
stack level too deep. (limit=(0x40000 - 128)) (SystemStackError)
```
but get segfault.
Signed-off-by: Go Saito <gos@iij.ad.jp >
2015-02-23 11:25:21 +09:00
Yukihiro "Matz" Matsumoto
44d8a40bac
add a prototype declaration for mrb_fiber_resume(); ref #1269
2015-02-19 11:38:05 +09:00
Yukihiro "Matz" Matsumoto
0609abb3f7
new API function mrb_fiber_resume(); ref #1269
2015-02-19 10:02:43 +09:00
Yukihiro "Matz" Matsumoto
80c343aec9
add description comment to mrb_fiber_yield()
2015-02-19 10:02:02 +09:00
Yukihiro "Matz" Matsumoto
9248cdd6cc
silence warnings in fmt_fp.c
2015-02-16 14:50:01 +09:00
Yukihiro "Matz" Matsumoto
a88a20d51f
Merge pull request #2723 from cremno/use-musl-fmt_fp
...
re-implement mrb_float_to_str()
2015-02-16 14:42:01 +09:00