Hiroshi Mimaki
1c09046c13
Update release date.
2018-12-11 10:52:20 +09:00
Hiroshi Mimaki
716e7b815f
Fixed missing comma in mruby/mirb usage.
2018-12-11 09:37:23 +09:00
Hiroshi Mimaki
e3ae0e4f29
Merge branch 'master' into stable
2018-11-27 09:09:20 +09:00
Yukihiro "Matz" Matsumoto
26475d0a78
Update doc/limitations.md for argument destructuring.
2018-11-25 18:03:27 +09:00
Yukihiro "Matz" Matsumoto
762f682b80
Allow destructuring in formal arguments.
...
e.g.
```
def m(a,(b,c),d); p [a,b,c,d]; end
m(1,[2,3],4) # => [1,2,3,4]
```
mruby limitation:
Destructured arguments (`b` and `c` in above example) cannot be accessed
from the default expression of optional arguments and keyword arguments,
since actual assignment is done after the evaluation of those default
expressions. Thus:
```
def f(a,(b,c),d=b)
p [a,b,c,d]
end
f(1,[2,3])
```
raises `NoMethodError` for `b` in mruby.
2018-11-25 09:07:49 +09:00
Yukihiro "Matz" Matsumoto
e6b72b2121
Remove redundant rules from parse.y.
2018-11-25 07:30:32 +09:00
Yukihiro "Matz" Matsumoto
7ed9bb3bd3
Fix wrong number of arguments in Array#fetch; fix #4170
2018-11-25 06:05:07 +09:00
Yukihiro "Matz" Matsumoto
e2e6554b56
Protect from exceptions raised outside of mrb_vm_run().
...
It can happen if signals are used (e.g. from `mruby-alarm` gem).
2018-11-25 06:05:07 +09:00
Yukihiro "Matz" Matsumoto
91bf55bbe5
Remove do { ... } while(0) hacks from MRB_TRY macros.
...
Because it can swallow `break` etc. if they are used in loops.
2018-11-25 06:05:07 +09:00
Hiroshi Mimaki
0711c861ca
Fix mruby-socket test failure on MinGW.
2018-11-22 09:49:00 +09:00
Yukihiro "Matz" Matsumoto
b158f26f0c
Merge pull request #4168 from robfors/doc
...
Add documentation to mrb_load_irep
2018-11-21 12:16:07 +09:00
Rob Fors
c9a66d4c41
Update documentation to mrb_load_irep
2018-11-20 21:27:03 -05:00
Yukihiro "Matz" Matsumoto
68c5384830
Update version number; fix #4165
2018-11-20 10:43:34 +09:00
Yukihiro "Matz" Matsumoto
ec19c34a20
Fixed a bug in mirb heredoc handling; fix #3989
2018-11-20 10:39:34 +09:00
Yukihiro "Matz" Matsumoto
f1eeaad84a
Stop special treating of \r in the lexer; fix #4132
2018-11-20 09:35:38 +09:00
Yukihiro "Matz" Matsumoto
86d102350b
Restrict total recursion number of ecall(); fix #3789
2018-11-20 09:14:34 +09:00
Yukihiro "Matz" Matsumoto
afd46eccd1
Add -fpermissive to C++ compiler flags.
2018-11-19 17:11:59 +09:00
Yukihiro "Matz" Matsumoto
65a2c2082d
Call mrb_str_to_str from mrb_string_value_ptr for compatibility.
2018-11-19 17:11:19 +09:00
Yukihiro "Matz" Matsumoto
53e2df3e93
Restore mrb_string_type function for compatibility.
2018-11-19 16:13:26 +09:00
Yukihiro "Matz" Matsumoto
c308a149f0
Add Hash type check for OP_KARG and OP_KEY_P; ref #4166
2018-11-19 15:35:59 +09:00
Yukihiro "Matz" Matsumoto
423f872c84
Need to keep rooms for empty splat; fix #4166
2018-11-19 15:26:19 +09:00
Yukihiro "Matz" Matsumoto
87ffab5713
Adjust codedump output format; ref #4166
2018-11-19 15:25:42 +09:00
Yukihiro "Matz" Matsumoto
9516731329
Use type checking mrb_to_str instead of converting mrb_str_to_str.
2018-11-19 12:08:28 +09:00
Yukihiro "Matz" Matsumoto
c022e4643f
Avoid assignments from type checking String#__to_str.
2018-11-19 12:08:28 +09:00
Yukihiro "Matz" Matsumoto
610bcc88c2
Removed to_hash conversion method.
2018-11-19 12:08:28 +09:00
Yukihiro "Matz" Matsumoto
698f5f707c
Removed to_ary conversion method.
2018-11-19 12:08:28 +09:00
Yukihiro "Matz" Matsumoto
5bbcea9b3b
Removed try_convert method from Array and Hash.
2018-11-19 12:08:28 +09:00
Yukihiro "Matz" Matsumoto
b5d43a16a3
Removed String#try_convert method from mruby-string-ext gem.
...
Because `try_convert` method rarely used in production. For mruby users,
we have `__to_str` utility method to check string type.
2018-11-19 12:08:28 +09:00
Yukihiro "Matz" Matsumoto
ff08856fe3
Remove implicit conversion using to_str method; fix #3854
...
We have added internal convenience method `__to_str` which
does string type check.
The issue #3854 was fixed but fundamental flaw of lack of stack
depth check along with fibers still remains. Use `MRB_GC_FIXED_ARENA`
for workaround.
2018-11-19 12:05:46 +09:00
Yukihiro "Matz" Matsumoto
afca99a40b
Remove implicit conversion using to_int method.
...
The ISO standard does not include implicit type conversion using
`to_int`. This implicit conversion often causes vulnerability.
There will be no more attacks like #4120 .
In addition, we have added internal convenience method `__to_int` which
does type check and conversion (from floats).
2018-11-19 11:28:51 +09:00
Yukihiro "Matz" Matsumoto
426c1f9e0b
fix non-ASCII comment.
2018-11-19 11:28:03 +09:00
Yukihiro "Matz" Matsumoto
0a0cc5a217
Check method existence for Enumerators; fix #3920
...
The issue #3920 was fixed but the fundamental flaw of lack of stack
depth check along with fibers still remains, even though it's not
easy to cause the issue. Use `MRB_GC_FIXED_ARENA` to avoid the issue
for workaround.
After this patch, `obj.to_enum` raises `ArgumentError` if the object
does not respond to the enumerating method. This is incompatible to
CRuby but I think this behavior is better and CRuby should be updated
to behave like this.
2018-11-19 10:57:07 +09:00
Yukihiro "Matz" Matsumoto
31a961acf1
The current context may be changed in mrb_vm_exec; ref #3668 #4104
2018-11-19 09:50:31 +09:00
Yukihiro "Matz" Matsumoto
cab6b0f39b
Protect Fiber from GC in ecall(); fix #4104
2018-11-19 09:49:20 +09:00
Yukihiro "Matz" Matsumoto
25d390d6cc
Improve Hash table using variable sized segments.
2018-11-19 09:30:15 +09:00
Yukihiro "Matz" Matsumoto
180b73fec4
The key or value object could be reclaimed by GC; fix #4164
...
The GC may occur between `sg_shift` and `mrb_assoc_new`, in which
case `key` and `value` could be freed even tough they are still alive.
The issue is found and fixed by https://hackerone.com/hexodus
2018-11-16 01:04:57 +09:00
Yukihiro "Matz" Matsumoto
0a022f7b8d
The saved pc from ERR_PC_SET was wrong; fix #4138
...
The saving `pc` position should be beginning of the instruction.
But after `mruby 2.0` byte code modification, the `pc` variable
points the beginning of the next instruction. We save the previous
position in a local variable `pc0`.
2018-11-15 23:34:32 +09:00
Yukihiro "Matz" Matsumoto
418ad65db4
Fixed a bug in continuous read of target files; ref #4138
...
Line number information in a compiled file was wrong.
2018-11-15 23:34:32 +09:00
Yukihiro "Matz" Matsumoto
7e3e8d8ed5
Shrink file name table size to uint16_t; ref #4138
2018-11-15 23:34:32 +09:00
Yukihiro "Matz" Matsumoto
faf51f82c7
Rename local variables in mrb_debug_info_append_file
2018-11-15 23:34:32 +09:00
Yukihiro "Matz" Matsumoto
56db3cf3eb
Simplify argument parsing; ref #4161
2018-11-15 21:01:56 +09:00
Yukihiro "Matz" Matsumoto
f39f428ed4
Silence -fsanitize=undefined warning in src/enum.c; fix #4161
2018-11-15 21:01:56 +09:00
Yukihiro "Matz" Matsumoto
61f49690e4
Remove filename&lines from mrb_irep struct.
...
This patch slightly reduce memory consumption (2% for my test).
2018-11-15 21:01:56 +09:00
Yukihiro "Matz" Matsumoto
1bea1e2050
Small renaming refactor in dump.c
2018-11-15 19:24:45 +09:00
Yukihiro "Matz" Matsumoto
485955eccc
String#{squeeze,delete,count} to use bitmap for matching; ref #4163
2018-11-15 04:51:27 +09:00
Yukihiro "Matz" Matsumoto
4550f4e381
Pattern length may overflow uint16_t; fixed #4163
...
The issue is reported by `https://hackerone.com/dgaletic `.
2018-11-15 02:03:54 +09:00
Yukihiro "Matz" Matsumoto
c3188cac43
Merge pull request #4160 from mimaki/wrong-negative-float-in-mrb
...
Wrong pool data length for negative floating value in a mrb file.
2018-11-07 18:22:13 +09:00
Hiroshi Mimaki
7d7f9feee7
Wrong pool data length for negative floating value in a mrb file.
2018-11-07 17:20:18 +09:00
Yukihiro "Matz" Matsumoto
d25ebec988
Fixed wrong ArgumentError with keyword arguments; fix #4159
2018-11-05 21:52:17 +09:00
Yukihiro "Matz" Matsumoto
d47003aea4
Fixed a bug in argument number check with kwargs; fix #4159
2018-11-05 07:44:25 +09:00
Yukihiro "Matz" Matsumoto
d9e2532552
Remove reserved symbols for now.
...
It should be done by planned embedded symbols.
2018-11-02 22:58:12 +09:00
Yukihiro "Matz" Matsumoto
9c5e28646b
Merge pull request #4151 from take-cheeze/remove_op_symidx
...
Reduce instruction size
2018-11-02 22:37:47 +09:00
Yukihiro "Matz" Matsumoto
788e4388f8
Merge branch 'take-cheeze-fix_dump_load'
...
Since our new VM instruction is byte based, there's no need to endian
conversion of instruction sequences.
2018-11-02 20:58:15 +09:00
take-cheeze
57a435aa1d
Suppress warning
2018-11-02 15:49:34 +09:00
take-cheeze
659c680a5b
Fix dump and load with endianess
2018-11-02 15:47:28 +09:00
Yukihiro "Matz" Matsumoto
0419f07915
Add NULL checks for mrb->ci and proc->upeer; #4024
2018-11-02 14:57:03 +09:00
Yukihiro "Matz" Matsumoto
f2084f300b
Add tests for empty patterns for tr and count; #4156 #4157
2018-11-02 08:58:21 +09:00
Yukihiro "Matz" Matsumoto
8e59695625
Empty pattern string for String#tr should remove characters; fix #4157
2018-11-02 08:55:17 +09:00
Yukihiro "Matz" Matsumoto
65b04066a2
Empty pattern string can generate TR_UNINITIALIZED pattern; fix #4156
2018-11-02 08:54:24 +09:00
Yukihiro "Matz" Matsumoto
7ad53273a2
Silence Appveyor's VC compilation warnings.
2018-11-01 22:52:12 +09:00
Yukihiro "Matz" Matsumoto
d68da042b3
The env object referenced from fibers may be freed; fix #4154
...
By dffa203 that reclaim `env` objects from heaps, there's more chance
for `env` objects referenced from fibers may be freed from heap pages.
2018-11-01 22:36:06 +09:00
Yukihiro "Matz" Matsumoto
830321fed5
Merge pull request #4155 from mimaki/fix-4153
...
Fixed a bug in INIT_DISPATCH for non direct threading; fix #4153
2018-11-01 22:31:31 +09:00
Hiroshi Mimaki
73727aeb50
Fixed a bug in INIT_DISPATCH for non direct threading; fix #4153
2018-11-01 11:10:47 +09:00
Yukihiro "Matz" Matsumoto
31eb5f4e1b
Merge pull request #4152 from take-cheeze/build_debug_flag
...
Add debug flag to `MRuby::Build`
2018-10-30 09:04:35 +09:00
Yukihiro "Matz" Matsumoto
cca5e0977c
VS 2017 C does not understand inline struct initialization; ref #4153
2018-10-30 09:01:12 +09:00
take-cheeze
08bd095446
Add debug flag to MRuby::Build
2018-10-29 20:10:03 +09:00
take-cheeze
6a6586ca84
Reduce unnecessary symbol table entry
2018-10-29 19:40:33 +09:00
take-cheeze
486c9d902d
Fix codedumper
2018-10-29 19:35:31 +09:00
take-cheeze
7d51a7bbf5
Fix document
2018-10-29 19:34:56 +09:00
take-cheeze
557805da07
Fix operator
2018-10-29 19:29:43 +09:00
take-cheeze
68714ab648
Fix SEGV
2018-10-29 19:26:00 +09:00
take-cheeze
e022080390
Define null symbol
2018-10-29 19:22:53 +09:00
take-cheeze
3248de83b6
Reduce instruction size
2018-10-29 19:17:05 +09:00
Yukihiro "Matz" Matsumoto
eebb56713e
Merge pull request #4149 from take-cheeze/static_tr_pattern
...
Keep `tr_pattern` static if possible
2018-10-29 15:34:07 +09:00
Yukihiro "Matz" Matsumoto
ae5463c9e4
Merge pull request #4148 from take-cheeze/rename_libmruby_stuff
...
Rename `MRuby::Build#libmruby` stuff to avoid confusion
2018-10-29 15:13:24 +09:00
Yukihiro "Matz" Matsumoto
63fade1396
Merge pull request #4147 from take-cheeze/add_missing_dep
...
Add missing dependency of source code generator
2018-10-29 15:12:07 +09:00
Yukihiro "Matz" Matsumoto
a7e42a2024
Merge pull request #4146 from take-cheeze/sup_sleep_warn
...
Suppress sleep test script warning
2018-10-29 15:11:07 +09:00
Yukihiro "Matz" Matsumoto
c7327c84dc
Merge pull request #4145 from take-cheeze/sort_test_rbfiles
...
Sort test script list too
2018-10-29 15:10:36 +09:00
take-cheeze
b37b312081
Rename libmruby stuff to avoid confusion
2018-10-29 14:07:16 +09:00
take-cheeze
c240aeada9
Add missing dependency of source code generator
2018-10-29 13:58:57 +09:00
take-cheeze
1b185f08e7
Suppress sleep test script warning
2018-10-29 13:58:25 +09:00
take-cheeze
ac512e9d9f
Sort test script list too
2018-10-29 13:57:41 +09:00
take-cheeze
52d55e6069
Keep tr_pattern static
2018-10-29 13:21:36 +09:00
Yukihiro "Matz" Matsumoto
fa33a4d75a
We need no write barrier here; ref #4143
2018-10-29 12:01:27 +09:00
Yukihiro "Matz" Matsumoto
3dc3643e34
Marking from terminated fibers are not needed; ref #4143
...
The old condition marks the top-level callinfo even after the
fiber is terminated.
2018-10-29 11:58:10 +09:00
Yukihiro "Matz" Matsumoto
34872e90d4
Re-implement Array#_inspect and Hash#_inspect without blocks.
...
To reduce the env object allocation; ref #4143
2018-10-29 11:55:49 +09:00
Yukihiro "Matz" Matsumoto
dffa203d07
Need to mark shared env objects as MRB_TT_FREE; fix #4143
...
The following code mistakenly exits from the function without marking
the env object as `MRB_TT_FREE`.
``` ruby
if (MRB_ENV_STACK_SHARED_P(e)) {
/* cannot be freed */
return; // <- should be `break`
}
```
2018-10-29 11:51:04 +09:00
Yukihiro "Matz" Matsumoto
7ff84789c3
Add argument check to Array#clear; fix #4144
2018-10-29 10:12:10 +09:00
Yukihiro "Matz" Matsumoto
b3a181aaa1
Fixed a bug in processing OP_EXT? instructions.
...
fix haconiwa/haconiwa#171
2018-10-23 21:10:03 +09:00
Yukihiro "Matz" Matsumoto
80b5a56f51
Need to freeze string keys.
2018-10-20 19:02:12 +09:00
Yukihiro "Matz" Matsumoto
e89676a6ec
Merge pull request #4142 from iij/mergesort
...
replace quicksort with mergesort.
2018-10-18 13:02:11 +08:00
Tomoyuki Sahara
91444c4747
replace quicksort with mergesort.
2018-10-18 13:07:47 +09:00
Yukihiro "Matz" Matsumoto
fdd5ce8fac
Fixed a bug caused by too much optimization; fix #4137
2018-10-13 00:31:13 +09:00
Yukihiro "Matz" Matsumoto
d2313aebd6
Fixed broken stack consistency; fix #4135
2018-10-12 23:26:14 +09:00
Yukihiro "Matz" Matsumoto
e5f160dc7e
Should not compare undef (deleted) key in hashes; fix #4136
2018-10-12 19:00:45 +09:00
Yukihiro "Matz" Matsumoto
ab0f4db688
Call uniq! for each union processing in Array#union.
2018-10-12 19:00:14 +09:00
Yukihiro "Matz" Matsumoto
249fef7dc4
Add NULL check in sg_compact(); fix #4139
2018-10-12 08:30:57 +09:00
Yukihiro "Matz" Matsumoto
82e00ce60f
Hash#delete should return the deleted value; fix #4133
2018-10-12 08:25:54 +09:00
Yukihiro "Matz" Matsumoto
a690aef8d3
Merge pull request #4131 from junaruga/feature/ci-refactoring
...
Refactor .travis.yml to remove duplicated env: MRUBY_CONFIG.
2018-10-05 22:10:51 +09:00
Jun Aruga
f38e6c63e9
Refactor .travis.yml to remove duplicated env: MRUBY_CONFIG.
2018-10-05 14:15:33 +02:00
Yukihiro "Matz" Matsumoto
8392578216
Fixed SEGV from eval called form top-level mrb_funcall(); fix #4028
2018-10-02 17:26:43 +09:00
Yukihiro "Matz" Matsumoto
e6841abad6
Fixed a String#squeeze bug in handling iso-8859-1 strings; ref #4127
2018-09-27 21:43:35 +09:00
Yukihiro "Matz" Matsumoto
54ec08c7f1
Implement Hash#rehash in C using sg_compact().
2018-09-26 23:09:48 +09:00
Yukihiro "Matz" Matsumoto
d78acc7afe
Add index to larger segment lists for performance
2018-09-26 23:09:48 +09:00
Yukihiro "Matz" Matsumoto
8ffd4e47fb
Use mrb_undef_value for delete mark instead of shifting Hash entry table.
...
That means entry table should be compacted periodically by `sg_compact()`.
2018-09-26 23:09:48 +09:00
Yukihiro "Matz" Matsumoto
e8dcfe1745
Use segmented list to implement Hash [Experimental]
...
I know it's not hash at all, but reduce memory consumption.
2018-09-26 12:55:22 +09:00
Yukihiro "Matz" Matsumoto
01c2f59e14
Revert "Fix comparisons in str_squeeze."
...
This reverts commit 7b04fcd092 .
The issue was addressed by 9e3cbaa . No longer needed.
2018-09-26 12:35:25 +09:00
Yukihiro "Matz" Matsumoto
9e3cbaaacd
Avoid using memmove() for performance; fix #4130
2018-09-26 12:20:37 +09:00
Yukihiro "Matz" Matsumoto
87ce740168
Disambiguate block braces.
2018-09-26 12:17:38 +09:00
Yukihiro "Matz" Matsumoto
fb49a94314
Rename tr_pattern_free() to tr_free_pattern().
2018-09-26 12:17:38 +09:00
Yukihiro "Matz" Matsumoto
78195eb2ae
Small refactoring in vm.c
2018-09-26 12:17:38 +09:00
Yukihiro "Matz" Matsumoto
09a99154c0
Merge pull request #4128 from take-cheeze/patch-1
...
Fix memory leak in `mrb_str_count`
2018-09-25 12:03:26 +09:00
Takeshi Watanabe
67897195de
Fix leak in mrb_str_count
2018-09-25 11:48:59 +09:00
Yukihiro "Matz" Matsumoto
152e8c5bb2
Merge pull request #4127 from clayton-shopify/fix-str-squeeze-comparisons
...
Fix comparisons in str_squeeze.
2018-09-25 11:43:41 +09:00
Daniel Varga
4d5e3e1e63
Fix minor typos ( #4126 )
2018-09-25 09:14:01 +09:00
Clayton Smith
7b04fcd092
Fix comparisons in str_squeeze.
2018-09-24 18:16:12 -04:00
sbsoftware
8fc56f062e
Add compiler flag to disable direct threading ( #4075 )
...
* Add option to disable direct threading
* Prepend MRB_ to option name
2018-09-21 11:22:53 +09:00
Yukihiro "Matz" Matsumoto
9bd2a3b5d9
Fixed a top-level local variable bug in mirb.
...
`OP_STOP` returned a wrong value.
2018-09-21 00:51:29 +09:00
Yukihiro "Matz" Matsumoto
346f154ece
Implement String#delete and #delete!; ref #4086
...
mruby restriction:
In mruby, `String#delete` only takes single pattern argument.
2018-09-21 00:03:07 +09:00
Yukihiro "Matz" Matsumoto
58f7f2361a
Implement String#count; ref #4086
...
mruby restriction:
In mruby, `String#count` does not take multiple pattern arguments,
but only one pattern.
2018-09-21 00:03:07 +09:00
Yukihiro "Matz" Matsumoto
68523b4ec4
Add String#squeeze and #squeeze!; ref #4086
...
mruby restriction:
`String#squeeze` can take more than 1 pattern arguments in CRuby,
in that case, the intersection of patterns will be used to match.
But in mruby, it doesn't take multiple patterns.
2018-09-21 00:03:07 +09:00
Yukihiro "Matz" Matsumoto
c0ae8a96a1
Add String#tr_s and String#tr_s!; ref #4086
2018-09-21 00:03:07 +09:00
Yukihiro "Matz" Matsumoto
58ba38fe1e
Add String#tr and #tr! to mruby-string-ext gem; fix #4086
...
This patch is based on `mruby/c` implementation by Hirohito Higashi.
We might need to add `#tr_s`, `#squeeze` and `#delete` as well.
Adding them should not be too hard using functions we implemented here.
2018-09-21 00:03:07 +09:00
Yukihiro "Matz" Matsumoto
f23f2bbdad
Implement Array#union which is introduced in Ruby2.6.
2018-09-21 00:01:48 +09:00
Yukihiro "Matz" Matsumoto
dd346be99a
Improve performance of Array#uniq!.
2018-09-20 23:56:53 +09:00
Yukihiro "Matz" Matsumoto
5ec5a41fd2
Merge branch 'dearblue-assign-anon-class-name'
2018-09-20 13:58:36 +09:00
Yukihiro "Matz" Matsumoto
159575f630
Renamed is_namespace() to namespace_p().
2018-09-20 13:57:43 +09:00
Yukihiro "Matz" Matsumoto
505e601730
Revert "Add MRB_IMPROVE_META_PROGRAMMING configuration"
...
This reverts commit 1997fcf98f .
It became the default behavior.
2018-09-20 13:53:55 +09:00
Yukihiro "Matz" Matsumoto
d192a52edb
Merge branch 'assign-anon-class-name' of https://github.com/dearblue/mruby into dearblue-assign-anon-class-name
2018-09-20 13:50:16 +09:00
Yukihiro "Matz" Matsumoto
3a9caad8eb
Move Symbol#to_proc to the core from mruby-symbol-ext gem.
...
Even though `Symbol#to_proc` is not included in ISO standard, the
`some_method(&:method_name)` is used very widely and convenient.
So we moved it to the core.
2018-09-20 13:47:29 +09:00
Yukihiro "Matz" Matsumoto
19d3bb2d90
Make #to_h to take a block; [ruby-core:89088]
2018-09-20 13:47:29 +09:00
Yukihiro "Matz" Matsumoto
fa5f5954da
Merge pull request #4112 from dearblue/fix-outer-module-name
...
Fix outer module name
2018-09-20 13:47:16 +09:00
Yukihiro "Matz" Matsumoto
b7e5c86612
Allow nested gemboxes; fix #4124
2018-09-20 11:10:34 +09:00
Yukihiro "Matz" Matsumoto
3820ef791f
Small refactoring in mruby-hash-ext.
2018-09-20 09:07:24 +09:00
Yukihiro "Matz" Matsumoto
8b43754644
Use mrb_to_flo() to check return value from to_f; fix #4115
...
The ISO standard does not include implicit type conversion using
`to_int`, `to_str` and sometimes `to_f`. For the compactness of the
mruby implementation, maybe we should remove those implicit conversion
from mruby.
2018-09-18 09:35:09 +09:00
Yukihiro "Matz" Matsumoto
e9b1d9dc2f
Array size may be changed in mrb_get_args() reentry.
...
fix #4116 ; fix #4117 ; fix #4118 ; fix #4119 ; fix #4120
2018-09-18 07:07:43 +09:00
Yukihiro "Matz" Matsumoto
0ff1540e8b
Merge pull request #4122 from blacktm/iphone-exclude-pipe-exec
...
Exclude pipe and exec on iOS/tvOS
2018-09-17 13:26:04 +09:00
Tom Black
82053dd945
Exclude pipe and exec on iOS/tvOS
...
Use of `execl()` is prohibited on these platforms
2018-09-15 13:55:11 -07:00
Yukihiro "Matz" Matsumoto
ed4dbce052
fixup! Add support for iOS platforms that does not support fork; fix #4113
2018-09-16 00:58:52 +09:00
Yukihiro "Matz" Matsumoto
05595c1284
Merge pull request #4121 from clayton-shopify/fix-sprintf-overflow
...
Prevent signed integer overflow.
2018-09-16 00:45:55 +09:00
Yukihiro "Matz" Matsumoto
2661ac7049
Add support for iOS platforms that does not support fork; fix #4113
2018-09-16 00:41:48 +09:00
Clayton Smith
2760cea451
Prevent signed integer overflow.
2018-09-14 16:53:26 -04:00
Yukihiro "Matz" Matsumoto
f93734f622
Merge pull request #4110 from dearblue/fix-typo1
...
Fix typo
2018-09-08 11:20:11 +09:00
dearblue
292ea06d4d
Fix outer module name
...
example:
a = Module.new
a::B = Module.new
p [a, a::B] # => [#<Module:0x801825890>, #<Class:0x801825890>::B]
# => [#<Module:0x801825890>, #<Module:0x801825890>::B] (Fixed)
2018-09-08 10:25:30 +09:00
dearblue
5e6cd86f6e
Fix to not define outer when outer is itself.
...
example:
a = Class.new
a::A = a
2018-09-07 23:56:06 +09:00
dearblue
366848996a
Clear terminated space
2018-09-07 22:32:34 +09:00
dearblue
1997fcf98f
Add MRB_IMPROVE_META_PROGRAMMING configuration
2018-09-07 22:32:34 +09:00
dearblue
1595e8368a
Fix indent
2018-09-07 22:32:34 +09:00
dearblue
9b0ef58a48
A class/module name is now defined for meta programing
2018-09-07 22:32:34 +09:00
dearblue
fd57af3ea4
Undesirable line split
2018-09-07 22:32:34 +09:00
dearblue
2a24b40d30
Not set a class/module name into anonymous class/module
2018-09-07 22:32:34 +09:00
dearblue
9da9e5eb4e
Fix typo for concatenate
2018-09-07 22:32:34 +09:00
Yukihiro "Matz" Matsumoto
625976d793
Fix integer overflow issue; fix #4108
...
I misunderstood the return value from `snprintf()`, which is NOT number
of characters written in buffer, but the number of character the buffer
has to have to write the complete output.
2018-09-07 03:20:57 +09:00
Yukihiro "Matz" Matsumoto
3447162a4c
Add a new method unpack1 to mruby-pack gem.
2018-09-07 02:16:56 +09:00
Yukihiro "Matz" Matsumoto
04f8b0431c
Fix heap buffer overflow in unpack_a; fix #4103
2018-09-07 02:15:55 +09:00
Yukihiro "Matz" Matsumoto
fdaec90780
Make Kernel#sleep to accept float as a duration time.
...
But when `MRB_WITHOUT_FLOAT` is set, there's no way to sleep for
sub seconds. So mruby specific `usleep` is provided.
2018-09-06 23:42:05 +09:00
Yukihiro "Matz" Matsumoto
72522f8e0e
Remove Sleep module that does not exist in CRuby.
2018-09-06 23:35:32 +09:00
Yukihiro "Matz" Matsumoto
0b44e802a9
Need to check if merging hash is empty; fix #4107
2018-09-06 23:30:32 +09:00
Yukihiro "Matz" Matsumoto
4cd4c64266
Need to support multiple ** splats in argument list; fix #4106
2018-09-06 14:40:21 +09:00
Yukihiro "Matz" Matsumoto
a170c1dd70
Refactored mruby-sleep gem.
...
* Method implementation functions made `static`.
* Function declaration style has been changed.
* Unnecessary header file `mrb_sleep.h` removed.
* Used `mrb_get_args()` instead of self parsing.
* Indentation kept untouched.
2018-09-05 14:55:49 +09:00
Yukihiro "Matz" Matsumoto
44fdd53f2e
Add mruby-sleep gem to the core.
2018-09-05 13:30:14 +09:00
Yukihiro "Matz" Matsumoto
b01b0d242b
Free mrbc_context on exit from mruby.
2018-09-05 07:58:36 +09:00
Yukihiro "Matz" Matsumoto
ade7185a2b
Merge pull request #4055 from take-cheeze/verbose_bintest
...
Support verbose mode in bintest.
2018-09-05 07:11:23 +09:00
Yukihiro "Matz" Matsumoto
2a9525caab
Add argv and argc check in OP_ENTER; fix #4102
...
`argv` may be retrieved from an array whose `ptr` is `NULL` when it`s
empty.
2018-09-05 07:06:25 +09:00
Yukihiro "Matz" Matsumoto
9b5910bd0f
Revert "Remove top-level constant lookup; CRuby2.5"; fix #4070
...
This reverts commit c96def7c96 .
This change was from my misunderstanding.
2018-09-04 21:19:07 +09:00
Yukihiro "Matz" Matsumoto
7592dfcf7d
Need more precise constant name check.
...
This change was inspired by [ruby-bugs#7573]
2018-09-04 20:50:54 +09:00
Yukihiro "Matz" Matsumoto
c2634e18b6
Add type casts to silence MSVC warnings.
2018-09-04 16:22:50 +09:00
Yukihiro "Matz" Matsumoto
28c50b3e90
Merge pull request #4101 from take-cheeze/fix_4085
...
Avoid root fiber initialization for CRuby.
2018-09-04 16:22:40 +09:00
take-cheeze
901dccb2df
Avoid root fiber initialization for CRuby workaround.
...
closes #4085 .
2018-09-04 16:18:01 +09:00
take-cheeze
e6357f3baa
Fix indent.
2018-09-04 16:18:01 +09:00
Yukihiro "Matz" Matsumoto
02adae167f
Merge pull request #4098 from dearblue/reverse-gems-final
...
Reversing gems final
2018-09-04 07:26:25 +09:00
dearblue
cbf2738861
Reverse gems final
2018-09-02 14:13:09 +09:00
Yukihiro "Matz" Matsumoto
a657117e4e
Avoid warning in MSVC compilation.
2018-09-01 17:36:35 +09:00
Yukihiro "Matz" Matsumoto
20c0c6330f
Too much peephole optimization in gen_call; fix #4091
...
It causes trouble for safe navigation operator.
2018-09-01 17:14:54 +09:00
Yukihiro "Matz" Matsumoto
b80e0ef742
Move Kernel#send to mruby-metaprog gem.
...
But `BasicObject#__send__` is still available from the core.
2018-09-01 11:20:30 +09:00
Yukihiro "Matz" Matsumoto
593c12a5cd
Avoid NoMethodError exception from mrb_func_basic_p.
2018-09-01 11:18:12 +09:00
Yukihiro "Matz" Matsumoto
05f377dee4
Use __send__ instead of send.
2018-09-01 11:02:59 +09:00
Yukihiro "Matz" Matsumoto
0c6353aa2c
Remove MRB_API from mrb_f_send which is not API.
2018-09-01 11:01:50 +09:00
Yukihiro "Matz" Matsumoto
2be42aef0f
Fix ISO/JIS section numbers.
2018-09-01 09:35:46 +09:00
Yukihiro "Matz" Matsumoto
1bc1fed534
Update RITE_BINARY_FORMAT_VER and RITE_VM_VER.
...
The bytecode format was updated so the header version constants must be
updated as well.
2018-08-30 22:48:05 +09:00
Yukihiro "Matz" Matsumoto
50b840c9de
Use mrb_ensure_hash_type() to check if an operand is a Hash; fix #4097
2018-08-30 22:30:36 +09:00
Yukihiro "Matz" Matsumoto
f6564dd83e
Add new function mrb_ensure_hash_type(); ref #4097
...
Unlike `mrb_check_hash_type()` that returns `nil` if the argument is
not a `Hash`, `mrb_ensure_hash_type()` raises a `TypeError` exception.
2018-08-30 22:30:36 +09:00
Yukihiro "Matz" Matsumoto
e471d37ca5
Separate meta-programming features to mruby-metaprog gem.
...
We assume meta-programming is less used in embedded environments.
We have moved following methods:
* Kernel module
global_variables, local_variables, singleton_class,
instance_variables, instance_variables_defined?, instance_variable_get,
instance_variable_set, methods, private_methods, public_methods,
protected_methods, singleton_methods, define_singleton_methods
* Module class
class_variables, class_variables_defined?, class_variable_get,
class_variable_set, remove_class_variable, included_modules,
instance_methods, remove_method, method_removed, constants
* Module class methods
constants, nesting
Note:
Following meta-programming methods are kept in the core:
* Module class
alias_method, undef_method, ancestors, const_defined?, const_get,
const_set, remove_const, method_defined?, define_method
* Toplevel object
define_method
`mruby-metaprog` gem is linked by default (specified in default.gembox).
When it is removed, it will save 40KB (stripped:8KB) on x86-64
environment last time I measured.
2018-08-30 22:30:36 +09:00
Yukihiro "Matz" Matsumoto
75a01af710
Remove consequent OP_RETURN by peephole optimization.
2018-08-30 01:23:17 +09:00
Yukihiro "Matz" Matsumoto
5addd5db4a
Need to clear mrb->c->cibase->ridx (toplevel ridx) at L_STOP; fix #4092
...
This problem only appears when `mrb` executed multiple times (i.e. `mirb`)
2018-08-30 01:20:59 +09:00
Yukihiro "Matz" Matsumoto
500bd38dfe
uint16_t is too small for reference count; fix #4093
...
Use `uint32_t` instead. Theoretically `uint32_t` can overflow as well,
but I think it is sufficient size for embeddable Ruby VM.
2018-08-30 00:29:35 +09:00
Yukihiro "Matz" Matsumoto
2c93e4a0a8
The operand of OP_ARYDUP may not be an array; fix #4094
...
This commit also fix #4096 .
2018-08-30 00:29:35 +09:00
Yukihiro "Matz" Matsumoto
f76cc483d5
Fix off-by-one error in OP_EPUSH and OP_ONERR; fix #4095
2018-08-29 23:59:20 +09:00
Yukihiro "Matz" Matsumoto
e91b6a0378
Merge pull request #4080 from 'ukrainskiysergey-node_negate_fix'
2018-08-29 13:34:02 +09:00
Yukihiro "Matz" Matsumoto
441ff45a51
Merge branch 'node_negate_fix' of https://github.com/ukrainskiysergey/mruby into ukrainskiysergey-node_negate_fix
2018-08-29 13:29:54 +09:00
Yukihiro "Matz" Matsumoto
98c759e86a
Check the size of rescue&ensure stacks; ref #4088
...
Those small stack indexes can cause integer overflow.
2018-08-29 13:17:18 +09:00
Yukihiro "Matz" Matsumoto
2a88a546b2
Fix type of eidx and ridx from uint8_t to uint16_t; fix #4088
...
A byte was too small to hold ensure&rescue stacks indexes.
2018-08-29 13:15:24 +09:00
Yukihiro "Matz" Matsumoto
6aa091e5aa
Simplified #ifdef nesting in codedump.c; fix #4089
...
`printf()` and related functions should not be called when
`MRB_DISABLE_STDIO` is defined.
2018-08-29 12:37:07 +09:00
Yukihiro "Matz" Matsumoto
bc88fc6ed1
Check iseq buffer size before code emission; fix #4090
...
The type of `s->pc` is now `uint16_t` that can be overflowed easily.
Need more checks.
2018-08-29 12:31:48 +09:00
Yukihiro "Matz" Matsumoto
814b7b5ef8
Move back mrb_define_alias to mruby.h to avoid breakage.
2018-08-29 07:00:13 +09:00
Yukihiro "Matz" Matsumoto
93bab387a7
Merge branch 'mruby2-draft'
2018-08-28 22:13:52 +09:00
Yukihiro "Matz" Matsumoto
471288f37d
Reduce integer casting warnings.
2018-08-25 16:58:01 +09:00
Yukihiro "Matz" Matsumoto
d79dbd92f9
fixup! New bytecode implementation of mruby VM.
2018-08-25 09:49:20 +09:00
Yukihiro "Matz" Matsumoto
49d1b16822
Hash splat ** should not be ignored.
...
Implemented by adding `OP_HASHCAT` that merges hashes.
2018-08-25 09:41:21 +09:00
Yukihiro "Matz" Matsumoto
306732e02d
Fixed a bug in OP_HASHADD.
2018-08-25 09:41:21 +09:00
Yukihiro "Matz" Matsumoto
a3fb80904d
Remove unused Hash#__update method.
2018-08-25 09:41:21 +09:00
Yukihiro "Matz" Matsumoto
3554fc54de
Add a new function mrb_hash_merge().
2018-08-25 09:41:21 +09:00
Yukihiro "Matz" Matsumoto
b06dad43fa
Remove unused NODE_* constants from node.h.
2018-08-25 09:41:21 +09:00
Yukihiro "Matz" Matsumoto
e5eb7ef046
Add NODE_KW_HASH support in mrb_parser_dump().
2018-08-25 09:41:21 +09:00
Yukihiro "Matz" Matsumoto
162243d95c
Remove arg_value from parse.y.
2018-08-25 09:41:21 +09:00
Yukihiro "Matz" Matsumoto
b7e56e9d20
Add bytecode support for MRB_WORD_BOXING.
2018-08-25 09:41:21 +09:00
Yukihiro "Matz" Matsumoto
eeb6d5658d
New bytecode implementation of mruby VM.
2018-08-25 09:41:21 +09:00
Yukihiro "Matz" Matsumoto
a16885efe5
Try to fix a fragile File#mtime test.
2018-08-25 09:19:17 +09:00
Yukihiro "Matz" Matsumoto
31827189ab
Remove potential path to avoid uninitialized variable access.
2018-08-25 09:19:17 +09:00
Yukihiro "Matz" Matsumoto
fbfe519be7
Simplify mruby-inline-struct tests.
...
`gcc -O3` raises error on truncation using `snprintf`.
2018-08-25 09:19:17 +09:00
Yukihiro "Matz" Matsumoto
b3a1d37926
Make Array.new to accept both integers and floats.
...
This time we used `Integral` module which is mruby specific.
2018-08-25 09:19:17 +09:00
Kazuhiro Sera
2b2ff844a1
Fix misspelling words in comments
2018-08-25 09:19:17 +09:00
Yukihiro "Matz" Matsumoto
b083c1351f
Fixed the corner case bug in String#{gsub!,sub!}.
...
`"a".sub!("a", "a")` should not return `nil`.
2018-08-25 09:17:46 +09:00
pyama86
821135e2df
irep is released when Fiber is terminated
2018-08-25 09:17:46 +09:00
Yukihiro "Matz" Matsumoto
49d9fb8f41
Reimplement Hash#compact! to conform the standard behavior.
...
`Hash#compact!` should return `nil` if the receiver does not change.
2018-08-25 09:17:46 +09:00
Yukihiro "Matz" Matsumoto
9409a2ff6d
Rename ambiguous function names.
...
`mrb_iv_p` -> `mrb_iv_name_sym_p`
`mrb_iv_check` -> `mrb_iv_name_sym_check`
2018-08-25 09:17:46 +09:00
Yukihiro "Matz" Matsumoto
5e469d2b92
Remove utility functions: mrb_vm_iv_{get,set}.
2018-08-25 09:17:46 +09:00
Yukihiro "Matz" Matsumoto
c88fd32713
Revert 04dbbff.
...
Use segment list for instance variable again to reduce memory.
2018-08-25 09:16:01 +09:00
Yukihiro "Matz" Matsumoto
4c974b9523
Small refactoring.
...
The macro `RCLASS_SUPER`, `RCLASS_IV_TBL` and `RCLASS_M_TBL` are
removed from `include/mruby/class.h`.
2018-08-25 09:16:01 +09:00
Yukihiro "Matz" Matsumoto
f3564a405e
Small refactoring of flodivmod().
2018-08-25 09:16:01 +09:00
dearblue
322eb2328a
Fix mrb_value size with MRB_WORD_BOXING on 32-bit mode
2018-08-25 09:16:01 +09:00
Yukihiro "Matz" Matsumoto
6681e22c71
Simply use snprintf instead of custom fmt_fp,
...
Unless `MRB_DISABLE_STDIO` is set. `snprintf` is used anyway
if mruby is configured to use `stdio`. This change reduces 8KB
of program size on the Linux box.
2018-08-25 09:16:01 +09:00
Yukihiro "Matz" Matsumoto
91c08d7631
Remove nregs member from mrb_callinfo.
...
This means reducing one word per a call frame.
2018-08-25 09:16:01 +09:00
Yukihiro "Matz" Matsumoto
8a18d1539b
Should update ci->env to share the environment; fix #4073
2018-08-25 09:13:09 +09:00
Yukihiro "Matz" Matsumoto
fd086833ff
Reorganize flags values for classes; fix #3975
...
Renamed flag macro names as well:
`MRB_FLAG_IS_FROZEN` -> `MRB_FL_OBJ_FROZEN`
`MRB_FLAG_IS_PREPENDED` -> `MRB_FL_CLASS_IS_PREPENDED`
`MRB_FLAG_IS_ORIGIN` -> `MRB_FL_CLASS_IS_ORIGIN`
`MRB_FLAG_IS_INHERITED` -> `MRB_FL_CLASS_IS_INHERITED`
2018-08-25 09:13:09 +09:00
Yukihiro "Matz" Matsumoto
bfd11aab35
Check size of the integer multiply before actual overflow; fix #4062
2018-08-25 09:13:09 +09:00
Yukihiro "Matz" Matsumoto
fe77272c25
Kernel#p should return an array of arguments; fix #4083
...
Although the return value is not defined in ISO, it is better to behave
as CRuby does.
2018-08-18 22:40:44 +09:00
Yukihiro "Matz" Matsumoto
c095736002
Try to fix a fragile File#mtime test.
2018-08-13 23:15:52 +09:00
Yukihiro "Matz" Matsumoto
14206a75a3
Remove potential path to avoid uninitialized variable access.
2018-08-13 23:15:52 +09:00
Yukihiro "Matz" Matsumoto
1e52d47bc3
Simplify mruby-inline-struct tests.
...
`gcc -O3` raises error on truncation using `snprintf`.
2018-08-13 23:15:52 +09:00
Yukihiro "Matz" Matsumoto
fee9ec61bb
Make Array.new to accept both integers and floats.
...
This time we used `Integral` module which is mruby specific.
2018-08-13 23:15:52 +09:00
Yukihiro "Matz" Matsumoto
11d5782687
Merge pull request #4081 from seratch/fix-typo
...
Fix misspelling words in comments, docs
2018-08-11 10:35:13 +09:00
Kazuhiro Sera
b03f1f78e3
Fix misspelling words in comments
2018-08-11 00:28:32 +09:00
Ukrainskiy Sergey
fbe876b871
Added push() after OP_SEND
2018-08-10 06:44:19 +09:00
Ukrainskiy Sergey
672110dbe8
Small fix
2018-08-09 17:57:18 +09:00
Ukrainskiy Sergey
e3b181586c
Fix weird behavior of the NODE_NEGATE
2018-08-09 17:31:57 +09:00
Yukihiro "Matz" Matsumoto
35be8b2524
Fixed the corner case bug in String#{gsub!,sub!}.
...
`"a".sub!("a", "a")` should not return `nil`.
2018-08-07 23:03:17 +09:00
pyama86
54246db00a
irep is released when Fiber is terminated
2018-08-06 19:13:19 +09:00
Yukihiro "Matz" Matsumoto
62e8e910b2
Reimplement Hash#compact! to conform the standard behavior.
...
`Hash#compact!` should return `nil` if the receiver does not change.
2018-08-06 16:40:19 +09:00
Yukihiro "Matz" Matsumoto
0dca6206c1
Rename ambiguous function names.
...
`mrb_iv_p` -> `mrb_iv_name_sym_p`
`mrb_iv_check` -> `mrb_iv_name_sym_check`
2018-08-06 10:15:55 +09:00
Yukihiro "Matz" Matsumoto
8f386f7663
Remove utility functions: mrb_vm_iv_{get,set}.
2018-08-06 10:15:55 +09:00
Yukihiro "Matz" Matsumoto
14c7a9c548
Revert 04dbbff.
...
Use segment list for instance variable again to reduce memory.
2018-08-06 10:15:55 +09:00
Yukihiro "Matz" Matsumoto
afbbc0a2cb
Small refactoring.
...
The macro `RCLASS_SUPER`, `RCLASS_IV_TBL` and `RCLASS_M_TBL` are
removed from `include/mruby/class.h`.
2018-08-06 10:15:55 +09:00
Yukihiro "Matz" Matsumoto
005ccd9c7e
Small refactoring of flodivmod().
2018-08-06 10:15:55 +09:00
Yukihiro "Matz" Matsumoto
708d6a4964
Merge pull request #4077 from dearblue/fix-wordboxing-symbol
...
Fix to sizeof(mrb_value) is 4 bytes with MRB_WORD_BOXING on 32-bit mode
2018-08-06 10:15:34 +09:00
dearblue
ca01c8792d
Fix mrb_value size with MRB_WORD_BOXING on 32-bit mode
2018-08-05 20:33:44 +09:00
Yukihiro "Matz" Matsumoto
4713cd9eb7
Simply use snprintf instead of custom fmt_fp,
...
Unless `MRB_DISABLE_STDIO` is set. `snprintf` is used anyway
if mruby is configured to use `stdio`. This change reduces 8KB
of program size on the Linux box.
2018-08-01 16:50:44 +09:00
Yukihiro "Matz" Matsumoto
b9817b00a4
Remove nregs member from mrb_callinfo.
...
This means reducing one word per a call frame.
2018-08-01 13:18:32 +09:00
Yukihiro "Matz" Matsumoto
e89cc9b9fa
Should update ci->env to share the environment; fix #4073
2018-08-01 10:08:40 +09:00
Yukihiro "Matz" Matsumoto
d886676690
Merge pull request #4074 from znz/patch-1
...
Remove unmatched quotation mark
2018-08-01 09:26:23 +09:00
Kazuhiro NISHIYAMA
64748691de
Remove unmatched quotation mark
2018-07-31 22:09:45 +09:00
Yukihiro "Matz" Matsumoto
beb6e5c299
Bytecode support for mrdb.
2018-07-31 17:28:42 +09:00
Yukihiro "Matz" Matsumoto
889f0f5f36
Add test case corresponding to 53e2723.
2018-07-31 17:27:59 +09:00
Yukihiro "Matz" Matsumoto
8558627b9b
Reorganize flags values for classes; fix #3975
...
Renamed flag macro names as well:
`MRB_FLAG_IS_FROZEN` -> `MRB_FL_OBJ_FROZEN`
`MRB_FLAG_IS_PREPENDED` -> `MRB_FL_CLASS_IS_PREPENDED`
`MRB_FLAG_IS_ORIGIN` -> `MRB_FL_CLASS_IS_ORIGIN`
`MRB_FLAG_IS_INHERITED` -> `MRB_FL_CLASS_IS_INHERITED`
2018-07-31 16:48:50 +09:00
Yukihiro "Matz" Matsumoto
180f39bf4c
Check size of the integer multiply before actual overflow; fix #4062
2018-07-31 16:14:18 +09:00
Yukihiro "Matz" Matsumoto
4ce9058f64
Describe the difference of the keyword argument behavior.
...
The implementation of keyword arguments is heavily rely on the prototype
made by @take-cheeze in #3629 .
2018-07-31 03:26:53 +09:00
Yukihiro "Matz" Matsumoto
e27565152f
Removed merge hiccups in doc/opcode.md.
2018-07-31 03:20:27 +09:00
Yukihiro "Matz" Matsumoto
43173e1299
Removed unused instruction: OP_KDICT.
2018-07-31 03:20:00 +09:00
Yukihiro "Matz" Matsumoto
53e2723fae
Fixed a small bug in keyword argument parsing.
...
def m(a=1,**k) p [a,k] end
m(a: 1)
2018-07-31 03:14:42 +09:00
Yukihiro "Matz" Matsumoto
8c9e712784
Keyword argument implemented.
2018-07-30 22:58:01 +09:00
Yukihiro "Matz" Matsumoto
891839b976
New bytecode implementation of mruby VM.
2018-07-30 22:57:54 +09:00
Yukihiro "Matz" Matsumoto
b09d2eb900
Kernel#instance_eval should define singleton methods; fix #4069
2018-07-23 18:26:24 +09:00
Tomoyuki Sahara
cb42c98757
Merge pull request #4072 from katzer/fix/unsupported_servname
...
[mruby-socket] Network services might not be available
2018-07-21 20:07:37 +09:00
Sebastián Katzer
0bc8d1979c
Network services might not be available
2018-07-21 10:18:22 +02:00
Yukihiro "Matz" Matsumoto
e3bc680d98
Merge pull request #4068 from yurie/mrbc
...
add mrbc option `--remove-lv`
2018-07-11 15:09:57 +09:00
yuri
a921b936d6
move declaration of mrb_irep_remove_lv from dump.h to irep.h
2018-07-11 14:14:12 +09:00
yuri
5fef38e4c7
move mrb_irep_remove_lv to codegen.c in mruby-compiler
2018-07-10 15:44:25 +09:00
yuri
dabb20ddbb
add mrbc option --remove-lv
...
* refactor: move `irep_remove_lv` from `mruby-bin-strip` gem to src/dump and rename to `mrb_irep_remove_lv`
* add: mrbc option `--remove-lv` to remove LVAR section
2018-07-10 01:42:33 +09:00
Yukihiro "Matz" Matsumoto
ea435f99da
Merge pull request #4067 from katzer/patch-1
...
[mruby-test] Fix task name is not necessarily a valid path
2018-07-09 08:19:12 +09:00
Sebastián Katzer
b1f1fe2f81
Fix task name is not necessarily a valid path
...
Errno::ENOENT: No such file or directory @ dir_s_mkdir - mruby:Z:/Documents
2018-07-08 13:51:00 +02:00
Yukihiro "Matz" Matsumoto
17c9e65603
Merge pull request #4066 from duangsuse/master
...
Added ~/Android/Sdk/ndk-bundle as default NDK home
2018-07-04 22:12:41 +09:00
duangsuse
06428059f6
Add ~/Android/Sdk/ndk-bundle as default NDK home
2018-07-04 19:33:11 +08:00
Yukihiro "Matz" Matsumoto
5bb3f60e49
Merge pull request #4064 from mame/mrb_without_float-for-mruby-io
...
Support MRB_WITHOUT_FLOAT to mruby-io
2018-07-02 11:00:35 +09:00
Yusuke Endoh
7917b7f8bf
Support MRB_WITHOUT_FLOAT to mruby-io
2018-07-02 10:47:56 +09:00
Yukihiro "Matz" Matsumoto
adb1eae912
Use mrb_raise() instead of mrb_raisef(); ref #4062
2018-06-28 22:40:24 +09:00
Yukihiro "Matz" Matsumoto
e60829405c
Merge pull request #4063 from graywolf/patch-1
...
Add information about Kernel#binding
2018-06-28 08:43:25 +09:00
W
3116d06003
Add information about Kernel#binding
2018-06-27 12:20:24 +00:00
Yukihiro "Matz" Matsumoto
695f29cd60
Add negative check in mrb_str_resize; fix #4062
2018-06-27 16:32:24 +09:00
Yukihiro "Matz" Matsumoto
7e79840587
initialize a local variable to avoid warning
2018-06-22 12:03:52 +09:00
Yukihiro "Matz" Matsumoto
351614bbdd
Merge pull request #4059 from take-cheeze/parallel_tests
...
Run tests parallelly for each target.
2018-06-22 12:02:09 +09:00
Yukihiro "Matz" Matsumoto
864a998c24
Merge pull request #4058 from take-cheeze/exp_sleep
...
Increase sleep duration exponentially instead of `Thread.pass`.
2018-06-22 12:01:33 +09:00
take-cheeze
eaf463ada3
Run tests parallelly for each target.
2018-06-22 11:43:14 +09:00
take-cheeze
48ba7c7bb0
Increase sleep duration exponentially instead of Thread.pass.
2018-06-22 11:41:12 +09:00
Yukihiro "Matz" Matsumoto
3671404391
Merge pull request #4053 from take-cheeze/use_transfer
...
Use Fiber#transfer instead in minirake.
2018-06-22 10:26:37 +09:00
Yukihiro "Matz" Matsumoto
410a5031fc
Merge pull request #4057 from take-cheeze/use_thread_pass
...
Use `Thread.pass` instead of sleeping.
2018-06-22 10:19:16 +09:00
take-cheeze
61e8f831dd
Use Thread.pass instead of sleeping.
2018-06-22 09:29:59 +09:00
Yukihiro "Matz" Matsumoto
36e1796e41
Merge branch 'master' into use_transfer
2018-06-22 07:23:50 +09:00
Yukihiro "Matz" Matsumoto
640fca3276
Merge pull request #4056 from take-cheeze/fix_rake_jobs
...
Fix job waiter of minirake.
2018-06-22 07:18:01 +09:00
Yukihiro "Matz" Matsumoto
485efd9253
Merge pull request #4054 from take-cheeze/show_rake_bt
...
Show minirake backtrace in verbose mode.
2018-06-22 07:16:48 +09:00
take-cheeze
7c246cb9db
Fix job waiter.
2018-06-21 12:45:55 +09:00
take-cheeze
acd04ad519
Support verbose mode in bintest.
2018-06-21 11:33:34 +09:00
take-cheeze
c90dbd12ef
Show minirake backtrace in verbose mode.
2018-06-21 11:29:50 +09:00
take-cheeze
6f35b07fab
Use Fiber#transfer instead in minirake.
2018-06-21 11:26:55 +09:00
Yukihiro "Matz" Matsumoto
fd9617cad0
Merge pull request #4052 from take-cheeze/fix_mtime_test
...
Use temporary file name for `File#mtime` test to avoid conflicts.
2018-06-20 23:19:52 +09:00
Yukihiro "Matz" Matsumoto
1829b76929
Merge pull request #4051 from take-cheeze/para_rake
...
Make minirake parallel.
2018-06-20 22:09:54 +09:00
take-cheeze
7bb2fc70f2
Set jobs to 4 since it have 2 CPUs.
2018-06-20 21:44:23 +09:00
take-cheeze
8f808cc9b1
Use temporary name for File#mtime test to avoid conflicts.
2018-06-20 21:42:48 +09:00
take-cheeze
33f72bb038
disable sudo.
2018-06-20 21:34:03 +09:00
take-cheeze
c3ac33d9cd
Make minirake parallel.
2018-06-20 20:51:24 +09:00
Yukihiro "Matz" Matsumoto
cfed6e3a4b
Merge pull request #4050 from take-cheeze/fix_build_script
...
Fix build scripts.
2018-06-20 20:42:53 +09:00
Yukihiro "Matz" Matsumoto
1a9195285c
Merge pull request #4049 from take-cheeze/fix_mirb_leak
...
Fix memory leaks in mirb.
2018-06-20 19:13:43 +09:00
take-cheeze
b8fec13cab
Make codacy happy.
2018-06-20 18:29:11 +09:00
take-cheeze
1d7c69a7cb
Fix dependencies.
2018-06-20 18:23:08 +09:00
take-cheeze
a212428fed
Comment out unused variable.
2018-06-20 18:22:50 +09:00
take-cheeze
633599a2cb
Fix forgotten argument passing.
2018-06-20 18:21:57 +09:00
take-cheeze
dfddc6a09f
Fix dependencies.
2018-06-20 18:21:33 +09:00
take-cheeze
e050cfb349
Add forgotten mkdir_ps.
2018-06-20 18:20:26 +09:00
take-cheeze
26d143bda8
Fix memory leaks in mirb.
2018-06-20 18:16:25 +09:00
Yukihiro "Matz" Matsumoto
f29bc4607a
Add test_dependency from mruby-io to mruby-time.
2018-06-20 15:24:46 +09:00
Yukihiro "Matz" Matsumoto
54cd2623b3
Turn off enable_debug flag in build_config.rb by default.
...
This will improve the default performance of mruby; fix #4045
2018-06-20 15:24:46 +09:00
Yukihiro "Matz" Matsumoto
58d819f317
Merge pull request #4048 from kou/export-mrb-utf8-locale
...
Export mrb_utf8_from_locale() and mrb_locale_from_utf8()
2018-06-20 13:39:59 +09:00
Kouhei Sutou
e38d1d278b
Export mrb_utf8_from_locale() and mrb_locale_from_utf8()
2018-06-20 11:45:15 +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
Yukihiro "Matz" Matsumoto
a8122a9d56
Fix stack position in multiple assignment; fix #4008
...
This was caused by a patch from #2684 .
2018-05-01 12:25:04 +09:00
Yukihiro "Matz" Matsumoto
59c8fdd651
Update OP_APOST description; ref #4008
2018-04-28 15:36:23 +09:00
Yukihiro "Matz" Matsumoto
0fee6e1ee9
Fix broken support of MRB_WITHOUT_FLOAT; fix #4015
2018-04-28 15:15:28 +09:00
Yukihiro "Matz" Matsumoto
50a9c5d7c7
Update the patch to not use funcall in C; ref #4013
2018-04-28 11:26:23 +09:00
kimu_shu
4b29abc565
Fix Enumerable#hash on non 32-bit integer conf.
2018-04-28 11:26:23 +09:00
Yukihiro "Matz" Matsumoto
84b499d02b
Merge pull request #4014 from mruby/stable
...
Set the mruby-1.4.1 release date to `2018-4-27`.
2018-04-28 10:08:56 +09:00
Yukihiro "Matz" Matsumoto
b956c0f43c
Merge pull request #4012 from take-cheeze/fix_heap_use_after_free
...
Fix heap use after free on mruby-aws-sigv4.
2018-04-28 10:08:20 +09:00
Hiroshi Mimaki
023070a639
Set the mruby-1.4.1 release date to 2018-4-27.
2018-04-27 11:30:30 +09:00
Takeshi Watanabe
b8869498b7
Fix heap use after free on mruby-aws-sigv4.
2018-04-27 10:45:59 +09:00
Yukihiro "Matz" Matsumoto
1b261382a0
Merge pull request #4011 from kou/fix-gc-env-children
...
Fix wrong the number of marked objects of MRB_TT_ENV in gray mark phase
2018-04-26 23:00:25 +09:00
Kouhei Sutou
4194fe9d65
Fix wrong the number of marked objects of MRB_TT_ENV in gray mark phase
...
If MRB_TT_ENV has stack shared flag or bidx flag, flags is too large
than the real stack size.
2018-04-26 15:25:36 +09:00
Yukihiro "Matz" Matsumoto
1c66d42e47
Merge pull request #4010 from take-cheeze/fix_ary_replace_leak
...
Fix array replace leak error in mruby-uri.
2018-04-25 15:59:56 +09:00
Takeshi Watanabe
e66c990234
Fix array replace leak error in mruby-uri.
2018-04-25 13:27:00 +09:00
Yukihiro "Matz" Matsumoto
8bfad558f8
Merge pull request #4007 from iij/sort-should-not-consume-system-stack
...
sort method should not consume system stack.
2018-04-23 13:15:10 +09:00
Yukihiro "Matz" Matsumoto
1ca06f407b
Merge pull request #4006 from take-cheeze/fix_ub_check
...
Fix undefined error of pointer dereference.
2018-04-23 13:13:36 +09:00
Tomoyuki Sahara
f0e54df4fe
sort method should not consume system stack.
2018-04-23 12:28:15 +09:00
Takeshi Watanabe
25c40c2f12
Fix undefined error of pointer dereference.
2018-04-23 12:06:13 +09:00
Yukihiro "Matz" Matsumoto
2213deeeaa
Implement String#upto in Ruby.
...
Avoid using `mrb_yield` in C code. The function is not recommended.
Because it doesn't work well with fibers.
2018-04-21 22:30:54 +09:00
Yukihiro "Matz" Matsumoto
8b92ab5c7b
CRuby2.6 stops deprecating String#lines with a block.
...
`String#lines` (with a block) is now implemented in Ruby.
2018-04-19 17:33:00 +09:00
Yukihiro "Matz" Matsumoto
c79e81ebc3
String#lines with a block is deprecated style.
2018-04-19 09:07:11 +09:00
Yukihiro "Matz" Matsumoto
54905e98cf
ary_dup() should not use `ary_replace(); fix #4004
...
Otherwise the duplicated object may have shared entities that
should not be modified in-line.
2018-04-18 17:30:33 +09:00
Yukihiro "Matz" Matsumoto
391e24210f
A new function ary_from_values(); ref #4004
2018-04-18 17:29:45 +09:00
Yukihiro "Matz" Matsumoto
c9275bbbed
mrb_io_initialize_copy should not free existing fptr; fix #4005
...
When arguments `copy` and `orig` are the same object.
2018-04-18 17:27:41 +09:00
Yukihiro "Matz" Matsumoto
05db341ef5
mrb_dup() should fail if fd is a negative integer; ref #4005
2018-04-18 17:25:52 +09:00
Yukihiro "Matz" Matsumoto
135b4773e3
Turn off major GC mode before full GC; fix #4000
2018-04-18 00:18:03 +09:00
Yukihiro "Matz" Matsumoto
0866fa38b0
Avoid unnecessary object allocation (addrinfo) in _accept; ref #3999
2018-04-18 00:18:03 +09:00
Yukihiro "Matz" Matsumoto
f7cf5812b1
Merge pull request #4003 from take-cheeze/int32_overflow
...
Fallback to float when compiled binary with 64bit compiler.
2018-04-17 23:08:36 +09:00
Takeshi Watanabe
87ef6aeb02
Fallback to float when caompiled binary with 64bit compiler.
...
closes #3997 .
2018-04-17 22:59:07 +09:00
Yukihiro "Matz" Matsumoto
4880f6dc89
Socket.accept should have returned [fd, addr]; fix #3999
2018-04-17 17:21:49 +09:00
Yukihiro "Matz" Matsumoto
0e76faed8c
Make ary_replace() to share entry buffers if possible.
2018-04-17 17:21:45 +09:00
Yukihiro "Matz" Matsumoto
5c15aa2f3b
Make ary_concat() to replace the receiver when it is empty.
2018-04-17 12:34:30 +09:00
Yukihiro "Matz" Matsumoto
c078783a5a
Make ary_replace() to take struct RArray* argument.
2018-04-17 12:33:01 +09:00
Yukihiro "Matz" Matsumoto
66b1695ba9
Define SOL_IP and SOL_TCP; ref #3999
2018-04-17 12:01:32 +09:00
Yukihiro "Matz" Matsumoto
d88191e7e7
Implement Array#__svalue in C.
2018-04-17 11:32:31 +09:00
Yukihiro "Matz" Matsumoto
b51b21fc63
Fix use after free in File#initilialize_copy; fix #4001
...
The bug and the fix were reported by https://hackerone.com/pnoltof
2018-04-17 09:57:41 +09:00
Yukihiro "Matz" Matsumoto
fabc460880
Invoke full GC when too many objects allocated during GC; fix #3998
...
When object allocation rate during incremental GC is too high, the
`gc->majorgc_old_threshold` becomes too big. This means major GC
start slower and old objects stay longer (and consume too much memory).
2018-04-14 06:18:49 +09:00
Yukihiro "Matz" Matsumoto
3b273243e6
Change MAJOR_GC_INC_RATIO to 120; ref #3998
...
Because 200% is consumes too much memory for some cases.
2018-04-14 06:13:00 +09:00
Yukihiro "Matz" Matsumoto
fc85016a32
Remove DEFAULT_ from DEFAULT_MAJOR_GC_INC_RATIO; ref #3998
...
Because unlike other GC ratio constants, it's not a default value.
2018-04-14 06:12:12 +09:00
Yukihiro "Matz" Matsumoto
c6736357a7
No longer need to insert write barriers for fibers.
...
Those barriers are inserted to fix #3699 but all living fibers are
marked from `mark_context()` anyway now.
2018-04-13 23:46:40 +09:00
Yukihiro "Matz" Matsumoto
e3e87ee26a
The #3871 fix caused wrong break from proc-closure error; fix #3996
2018-04-13 21:56:45 +09:00
Yukihiro "Matz" Matsumoto
4df0380f1e
Add fallthrough comment to silence gcc warning.
2018-04-13 11:23:27 +09:00
Yukihiro "Matz" Matsumoto
4b09c7364e
Silence gcc initializer warning.
2018-04-13 11:22:54 +09:00
Yukihiro "Matz" Matsumoto
1905091634
Check length of env stack before accessing upvar; fix #3995
2018-04-11 10:24:44 +09:00
Yukihiro "Matz" Matsumoto
e340b17252
Merge pull request #3994 from kou/fix-windows-build-error-on-dll-build
...
Fix build error on Windows with MRB_BUILD_AS_DLL
2018-04-10 16:35:48 +09:00
Kouhei Sutou
0bc6c17490
Fix build error on Windows with MRB_BUILD_AS_DLL
...
Error message:
C:\projects\groonga\vendor\mruby-source\include\mruby.h(1098): error C2375: 'mrb_gc_arena_save' : redefinition; different linkage [C:\projects\groonga\vendor\mruby\mruby.vcxproj]
C:\projects\groonga\vendor\mruby-source\include\mruby.h(1083) : see declaration of 'mrb_gc_arena_save'
C:\projects\groonga\vendor\mruby-source\include\mruby.h(1099): error C2375: 'mrb_gc_arena_restore' : redefinition; different linkage [C:\projects\groonga\vendor\mruby\mruby.vcxproj]
C:\projects\groonga\vendor\mruby-source\include\mruby.h(1084) : see declaration of 'mrb_gc_arena_restore'
2018-04-10 15:24:41 +09:00
Yukihiro "Matz" Matsumoto
e9ddb593f3
Merge pull request #3991 from take-cheeze/fix_eval_env_gc
...
Fix possible heap use after free in `mrb_exec_irep` and stack expanding.
2018-04-05 15:44:24 +09:00
Takeshi Watanabe
26e436e247
Adjust environment when mrb_exec_irep happened.
2018-04-05 11:53:30 +09:00
Yukihiro "Matz" Matsumoto
f23c3cddc8
Merge pull request #3990 from mimaki/fix-mrdb-illegal-free
...
Fixed memory failure on mruby debugger.
2018-04-04 15:44:49 +09:00
mimaki
e57d9e6047
Fixed test case for mruby ddebugger.
2018-04-04 14:07:59 +09:00
mimaki
c1b9ec0c30
Fixed illegal memory operation on mruby debugger.
2018-04-04 13:20:40 +09:00
Yukihiro "Matz" Matsumoto
951ebbafdc
Merge pull request #3988 from ksss/each_with_object
...
Refactoring for `Enumerable#each_with_object`
2018-03-28 14:50:41 +09:00
ksss
e683c95e90
Refactoring for Enumerable#each_with_object
...
`each_with_object` arity should be 1
2018-03-27 23:09:10 +09:00
Yukihiro "Matz" Matsumoto
a072015c4e
Merge pull request #3987 from ksss/enum-lazy-zip
...
Reimplement `Enumerable#zip` with Enumerator
2018-03-27 13:53:37 +09:00
Yukihiro "Matz" Matsumoto
211d417b02
Merge pull request #3986 from ksss/enum-zip
...
Support block yielding for Enumerable#zip
2018-03-27 13:52:13 +09:00
ksss
3a22d113ee
Reimplement Enumerable#zip with Enumerator
...
for fix some specs
- [passes each element of the result array to a block and return nil if a block is given](https://github.com/ruby/spec/blob/a585ec35d185435e5c11f371ba4ed2a29d8817bd/core/enumerable/zip_spec.rb#L11-L17 )
- [converts arguments to arrays using #to_ary](https://github.com/ruby/spec/blob/a585ec35d185435e5c11f371ba4ed2a29d8817bd/core/enumerable/zip_spec.rb#L23-L27 )
- [converts arguments to enums using #to_enum](https://github.com/ruby/spec/blob/a585ec35d185435e5c11f371ba4ed2a29d8817bd/core/enumerable/zip_spec.rb#L29-L34 )
- [gathers whole arrays as elements when each yields multiple](https://github.com/ruby/spec/blob/a585ec35d185435e5c11f371ba4ed2a29d8817bd/core/enumerable/zip_spec.rb#L36-L39 )
2018-03-27 10:53:33 +09:00
ksss
b1c8fad94a
Should raise TypeError instead of NoMethodError
2018-03-27 10:52:32 +09:00
ksss
5a7ce01f12
Support block yielding for Enumerable#zip
2018-03-27 10:51:59 +09:00
Yukihiro "Matz" Matsumoto
203b071ca2
Merge pull request #3985 from take-cheeze/revert_ai_protocol
...
Revert #3984 .
2018-03-26 11:07:50 +09:00
Takeshi Watanabe
baff7c63ee
Revert #3984 .
2018-03-26 11:02:05 +09:00
Yukihiro "Matz" Matsumoto
0da7b4454f
Merge pull request #3984 from take-cheeze/merge_socket
...
Catch up with latest mruby-socket.
2018-03-25 22:25:15 +09:00
Takeshi Watanabe
306cb99b10
Merge commit '36d016afd663d34607c843d03371bedb71efa34e'
2018-03-25 21:10:11 +09:00
Yukihiro "Matz" Matsumoto
4b5c21cf3b
Merge pull request #3982 from take-cheeze/fix_str_cmp
...
Return nil if type differ in `String#<=>`.
2018-03-24 16:27:22 +09:00
Takeshi Watanabe
77a3863a3d
Return nil if type differ in String#<=>.
2018-03-24 16:18:44 +09:00
Yukihiro "Matz" Matsumoto
8e8bc9e40b
Merge pull request #3974 from take-cheeze/repo_path
...
Add `:path` option for git repository.
2018-03-22 17:06:31 +09:00
Takeshi Watanabe
4940ddb9fc
Add :path option for git repository.
2018-03-22 12:42:41 +09:00
Yukihiro "Matz" Matsumoto
fb78f10893
Need to keep block argument in mrb_exec_irep; fix #3973
2018-03-22 01:01:18 +09:00
Yukihiro "Matz" Matsumoto
c8538be471
Needed to set ci->proc in OP_SUPER; fix #3966
2018-03-20 23:16:38 +09:00
Yukihiro "Matz" Matsumoto
a85bc19f35
Merge pull request #3972 from take-cheeze/fix_ary_set_len_assert
...
Set array length after expanding capacity.
2018-03-20 23:15:37 +09:00
Takeshi Watanabe
1218ff5d47
Set array length after expanding capacity.
2018-03-19 21:40:17 +09:00
Tomoyuki Sahara
36d016afd6
Set protocol of AddrInfo
...
backport https://github.com/mruby/mruby/pull/3891
2018-03-16 17:05:37 +09:00
Yukihiro "Matz" Matsumoto
1a8483f17e
__sort_sub__ is a method defined in Array; fix #3970
...
Reorganize `__sort_sub__` arguments.
2018-03-16 14:49:51 +09:00
Yukihiro "Matz" Matsumoto
1abff3f2ab
Merge pull request #3957 from take-cheeze/fix_io_read
...
Pass same mode parameter to `IO.sysopen` and `IO.open` in `IO.read`.
2018-03-16 14:34:44 +09:00
Yukihiro "Matz" Matsumoto
ceeb8c05df
Needed to pass sort block.
2018-03-16 08:20:43 +09:00
Yukihiro "Matz" Matsumoto
ec390e8f1b
Update mrb_get_args reference comment; ref #3963
2018-03-16 08:18:52 +09:00
Yukihiro "Matz" Matsumoto
6c84e6e4a5
Merge pull request #3969 from hfm/patch-1
...
Fix tinytypo
2018-03-16 08:18:38 +09:00
Okumura Takahiro
0664c452ee
Fix tinytypo
2018-03-16 00:19:09 +09:00
Yukihiro "Matz" Matsumoto
59dabb38ab
Merge pull request #3963 from dearblue/forced-block-arguments
...
Give me block by mrb_get_args() (forced block arguments)
2018-03-12 22:14:08 +09:00
Yukihiro "Matz" Matsumoto
843053c97c
Merge pull request #3965 from take-cheeze/patch-1
...
Add same fix as #3964 to lib/mruby/gem.rb .
2018-03-05 10:51:32 +09:00
Takeshi Watanabe
e8cea2accf
Add same fix as #3964 to lib/mruby/gem.rb .
2018-03-05 10:38:44 +09:00
Yukihiro "Matz" Matsumoto
e924501693
Merge pull request #3964 from take-cheeze/patch-1
...
Close `mrb_state` before error exit.
2018-03-05 10:26:02 +09:00
Takeshi Watanabe
0f5cf385b8
Close mrb_state before exit.
2018-03-05 10:13:55 +09:00
Takeshi Watanabe
94aebe3137
Close on exception too.
2018-03-05 10:12:33 +09:00
dearblue
a5ac49de30
fix && to &! in mrb_get_args()
2018-03-04 23:48:45 +09:00
dearblue
2ce6d23db6
add forced block arguments feature to mrb_get_args
2018-03-04 22:23:47 +09:00
Yukihiro "Matz" Matsumoto
10f28fc82d
Add mrb_fiber_alive_p to C API.
2018-03-02 10:14:36 +09:00
Yukihiro "Matz" Matsumoto
a95b6d34aa
Round up the dstlen value; fix #3949
...
The fix was proposed by https://hackerone.com/aerodudrizzt
2018-03-02 10:14:36 +09:00
Takeshi Watanabe
92641248fa
Pass same mode parameter to IO.sysopen and IO.open in IO.read.
2018-02-23 20:42:13 +09:00
Yukihiro "Matz" Matsumoto
097bfdcac5
Merge pull request #3953 from take-cheeze/fix_cross_test_runner_verbose
...
Add verbose flag to cross test runner too. [experimental]
2018-02-17 18:34:46 +09:00
Takeshi Watanabe
5d43a93046
Add verbose flag to cross test runner too.
2018-02-16 23:44:58 +09:00
Yukihiro "Matz" Matsumoto
75c1fccd08
Check if to_int returns fixnum value; fix #3946
2018-02-13 09:12:39 +09:00
Yukihiro "Matz" Matsumoto
ef1a0e6358
Check sizeof(base64_dec_tab) in base64 encoding; fix #3947
...
The issue (and the fix) reported by https://hackerone.com/aerodudrizzt
2018-02-13 08:55:24 +09:00
Yukihiro "Matz" Matsumoto
7483753094
Check negative offset in pack method; fix #3944
2018-02-13 08:48:23 +09:00
Yukihiro "Matz" Matsumoto
c5ec37a8ab
Fixed wrong offset in pack_x function; ref #3944
2018-02-13 08:47:33 +09:00
Yukihiro "Matz" Matsumoto
00845ea908
Use 'mrb_raise instead of mrb_raisef` when no argument given.
2018-02-13 08:35:01 +09:00
Yukihiro "Matz" Matsumoto
1d55260423
String#inspect to use hexadecimal, not octal to print unprintable.
2018-02-12 22:56:24 +09:00
Yukihiro "Matz" Matsumoto
b9523d0e06
Merge pull request #3945 from take-cheeze/fix_dep_core_gems
...
Fix core dependencies resolving in dependencies gems.
2018-02-12 22:41:31 +09:00
Yukihiro "Matz" Matsumoto
2c84d94854
Merge pull request #3915 from llothar/master
...
Uncommented the Visual Studio version check
2018-02-12 09:32:35 +09:00
Yukihiro "Matz" Matsumoto
4790f28d62
Resolve conflicts between labels and conditional ternary; fix #3931
2018-02-12 09:28:09 +09:00
Takeshi Watanabe
3dc8634d86
Fix core dependencies resolving in dependencies gems.
2018-02-10 23:23:57 +09:00
Yukihiro "Matz" Matsumoto
7a116f27e4
Need to determine IS_LABEL_POSSIBLE() properly.
...
Otherwise, `{"a": 1}` will cause `SyntaxError`.
2018-02-10 17:17:36 +09:00
Yukihiro "Matz" Matsumoto
79cfa377e1
Check negative count in pack_x and unpack_x; fix #3944
2018-02-10 16:59:14 +09:00
Yukihiro "Matz" Matsumoto
4f31bcbc84
Add mruby-io and mruby-pack to default.gembox
2018-02-10 16:58:59 +09:00
Yukihiro "Matz" Matsumoto
4c1494d58f
Check if mruby-pack template count overflow; fix #3942
2018-02-09 12:55:13 +09:00
Yukihiro "Matz" Matsumoto
b43c146455
Check ensure proc is NULL before calling; fix #3943
2018-02-09 12:34:54 +09:00
Yukihiro "Matz" Matsumoto
4c18e37f71
Merge pull request #3941 from matsumotory/patch-1
...
Depend mruby-io and mruby-pack in mruby core
2018-02-04 00:01:03 +09:00
MATSUMOTO, Ryosuke
6ae4fb707a
Depend mruby-io and mruby-pack in mruby core
2018-02-03 14:57:12 +09:00
Yukihiro "Matz" Matsumoto
e02cbb4426
Need fcntl.h and sys/stat.h as well for _open; ref #3938
2018-02-02 14:58:09 +09:00
Yukihiro "Matz" Matsumoto
c9fa7b1919
Need to include io.h anyway for _WIN32/64; ref #3938
2018-02-02 14:18:25 +09:00
Yukihiro "Matz" Matsumoto
cafe6ce4f4
Merge pull request #3940 from take-cheeze/fix_proc_ctx_access
...
Fix possible memory access error.
2018-02-02 14:16:10 +09:00
Takeshi Watanabe
3c18ec27e9
Fix possible memory access error.
2018-02-02 13:30:32 +09:00
Yukihiro "Matz" Matsumoto
6f1e1777cb
Merge pull request #3938 from mattn/include-io
...
include io.h on mingw
2018-01-31 12:32:23 +09:00
Yasuhiro Matsumoto
0e0dad7697
include io.h on mingw
2018-01-31 12:18:35 +09:00
Yukihiro "Matz" Matsumoto
f7ff2d0ee3
Define compatibility only for _MSC_VER; ref #3923
...
Suggested by @mattn.
2018-01-31 12:10:51 +09:00
Yukihiro "Matz" Matsumoto
1ad2dd6187
Merge pull request #3923 from ksss/tempnam
...
Shouldn't use tempnam
2018-01-31 11:58:49 +09:00
ksss
e422ba0bff
Use mkstemp instead of tempnam
2018-01-31 11:34:29 +09:00
Yukihiro "Matz" Matsumoto
55431b4cef
Need not to pop callinfo on OP_STOP.
2018-01-30 22:55:58 +09:00
Yukihiro "Matz" Matsumoto
43594843d7
Merge pull request #3937 from mattn/file-mtime
...
add File#mtime
2018-01-30 21:39:08 +09:00
Yasuhiro Matsumoto
f4f006ba40
add File#mtime
2018-01-30 16:02:00 +09:00
Yukihiro "Matz" Matsumoto
3498a787ba
Merge pull request #3936 from ken-mu/uint
...
mruby-time: support time_t is uint
2018-01-30 12:42:49 +09:00
ken-mu
a1b71b64b3
mruby-time: remove ifdef for mktime error handling
2018-01-29 09:43:43 +00:00
ken-mu
6a2c0c6e2a
mruby-time: support time_t is uint
2018-01-28 03:03:20 +00:00
Yukihiro "Matz" Matsumoto
83f2654bac
Do not use MRB_METHOD_TABLE_INLINE by default; fix #3924
...
It was default on Linux. Abandoned for 2 reasons:
* some cross-platform compiler defines `__linux__` even on bare metal
environment (RTL8196 (MIPS big endian soc) for example).
* some compilers do not align functions pointers so that we need to
specify `-falign-functions=n` (where n>1). It's not suitable for
default configuration.
By our measurement, `mrbtest` consumes 400KB less memory. So if your
target machine is memory tight, add the following command-line options
to `GCC` (unfortunately `clang` does not support `-falign-functions`).
`-falign-functions=2 -DMRB_METHOD_TABLE_INLINE`
2018-01-25 14:22:01 +09:00
Yukihiro "Matz" Matsumoto
ec1a5af719
Use LSB not MSB for MRB_METHOD_TABLE_INLINE; ref #3924
2018-01-25 14:02:38 +09:00
Yukihiro "Matz" Matsumoto
d895861a30
Check arena_idx before accessing; fix #3934
2018-01-25 12:30:10 +09:00
Yukihiro "Matz" Matsumoto
0e93f1ff12
Merge pull request #3921 from ksss/cloexec
...
Should be true for close_on_exec flag
2018-01-24 22:04:05 +09:00
Yukihiro "Matz" Matsumoto
dfb56074d6
Add big_endian and little_endian methods to CrossBuild; ref #3922
...
When your target machine is big endian, specify as following in the
`build_config.rb`:
```ruby
MRuby::CrossBuild.new('32bit') do |conf|
toolchain :gcc
conf.big_endian
end
```
2018-01-24 21:42:25 +09:00
Yukihiro "Matz" Matsumoto
3ff56a8e55
Time.new(1969,12,31,23,59,59) may or may not faile; ref #3932
...
On some platform and timezone it is a valid time spec.
2018-01-24 21:42:25 +09:00
Yukihiro "Matz" Matsumoto
f8ab3c1eeb
Merge pull request #3932 from ken-mu/timegm
...
mruby-time: Fix mruby specific timegm() cannot return minus
2018-01-21 21:10:01 +09:00
ken-mu
d398cd47d7
mruby-time: remove test case less than Dec 31 23:59:58 1969
2018-01-21 02:47:17 +00:00
ken-mu
a1f36316d2
mruby-time: Fix mruby specific timegm() cannot return minus
2018-01-20 13:09:58 +00:00
Yukihiro "Matz" Matsumoto
e5fb21b6d2
Detect cyclic link of class path references; fix #3926
2018-01-17 09:41:26 +09:00
Yukihiro "Matz" Matsumoto
3ae621fcb3
Typo fixed.
2018-01-17 09:38:41 +09:00
Yukihiro "Matz" Matsumoto
ec63b1a0e0
Limit size of iseq buffer; fix #3927
2018-01-16 15:17:56 +09:00
Yukihiro "Matz" Matsumoto
ca837b1a24
Allow -> do rescue; end as well as proc do rescue; end [Ruby2.6]
2018-01-16 15:08:51 +09:00
Yukihiro "Matz" Matsumoto
03e88b9ae0
Merge pull request #3930 from mruby/stable
...
Set the mruby-1.4.0 release date to `2018-1-16`.
2018-01-16 15:07:53 +09:00
Hiroshi Mimaki
58fb6f421a
Set the mruby-1.4.0 release date to 2018-1-16.
2018-01-16 10:15:19 +09:00
ksss
dc9c40f72d
Remove trailing space
2018-01-14 22:40:46 +09:00
ksss
540efd3730
IO#close_on_exec? is not supported on MinGW
2018-01-14 22:40:46 +09:00
ksss
e5e9d03482
Should be true for close_on_exec flag
2018-01-14 22:40:45 +09:00
Yukihiro "Matz" Matsumoto
623436276e
Merge pull request #3916 from mimaki/mruby-socket-cygwin-test
...
Passed mruby-test on Cygwin.
2017-12-26 15:51:18 +09:00
Hiroshi Mimaki
f55df0da7b
addrinfo.ai_protocol was not set on Cygwin.
2017-12-26 11:12:49 +09:00
Hiroshi Mimaki
bce811a53a
Disabled UNIXSocket test on Cygwin
2017-12-26 11:05:28 +09:00
Yukihiro "Matz" Matsumoto
6b09692684
Add `Integer#{allbits?,anybits?,nobits?}. [Ruby2.5]
...
In mruby, those methods are defined in `Integral` module.
2017-12-26 09:44:39 +09:00
Yukihiro "Matz" Matsumoto
3d7141b7fe
Move Intefer#chr to Integral#chr.
...
Since mruby mixes `Integer` and `Float`, integer operations have
been moved to `Integral` module.
2017-12-26 09:42:34 +09:00
Yukihiro "Matz" Matsumoto
ad17ba0e11
KeyError from Hash#fetch should inspect key.
...
To distinguish string keys and symbol keys.
2017-12-25 23:52:40 +09:00
Yukihiro "Matz" Matsumoto
e4a9b4a3ad
`Enumerable#{one?,none?,all?,any?} to take pattern argument [Ruby2.5]
2017-12-25 23:43:43 +09:00
Yukihiro "Matz" Matsumoto
421819dc2c
Add Hash#slice [Ruby 2.5]
2017-12-25 23:43:37 +09:00
Yukihiro "Matz" Matsumoto
df68a3345d
assert_equal() takes result as the first argument
2017-12-25 15:39:45 +09:00
Lothar Scholz
a9d0d90f74
Removed the Visual Studio Version Check because it does not
...
work with internationalized versions of Visual Studio. It will capture
the returned string in the local codepage encoding and make ruby exits
with an invalid UTF8 error message.
Also "Version" might be translated and not appear in the output.
2017-12-24 06:28:38 +01:00
Yukihiro "Matz" Matsumoto
2a5545cc25
Update Kernel#method_missing tests for new NoMethodError message.
...
Also removed tests that depends on implementation details of the default
`method_missing` behavior.
2017-12-23 15:18:13 +09:00
Yukihiro "Matz" Matsumoto
6999e45742
Do not include object string representation in NoMethodError message.
...
This information is not mandatory but causes a lot of problems in the
past due to infinite recursion by redefining `to_str`, `inspect` etc.
2017-12-23 15:15:03 +09:00
Yukihiro "Matz" Matsumoto
ca0f32a208
super should raise TypeError when the receiver is switched; fix #3911
...
The receiver can be switched using `#instance_eval` etc.
2017-12-23 11:14:12 +09:00
Yukihiro "Matz" Matsumoto
aa8786f79c
Do not initialize a local variable soon to be assigned.
2017-12-23 11:14:12 +09:00
Yukihiro "Matz" Matsumoto
7e520838b3
Avoid infinite recursion in method_missing; ref #3908
2017-12-23 11:13:27 +09:00
Yukihiro "Matz" Matsumoto
44b4f69fce
May need more stack space in mrb_funcall_with_block; fix #3908
2017-12-23 10:01:30 +09:00
Yukihiro "Matz" Matsumoto
8d7e95282c
Add #module_exec and #class_exec in mruby-class-ext gem.
2017-12-23 10:01:30 +09:00
Yukihiro "Matz" Matsumoto
7fbbd7ab9f
Should not overwrite ci->target_class in mrb_exec_irep().
...
For example, the following code behaved wrong:
```ruby
Object.instance_exec(1,2,3){|*a|
def foo
42
end
}
p foo()
```
2017-12-23 10:01:30 +09:00
Yukihiro "Matz" Matsumoto
7990bb7fa7
Merge pull request #3913 from llothar/master
...
Make source compilable with C++17
2017-12-23 09:44:00 +09:00
Lothar Scholz
06f90a3b45
Make source compilable with C++17
...
Changes applied:
- Removing "register" keyword
- Fixing const pointer to pointer assignments
- Adding type casts to rb_malloc calls
2017-12-23 01:10:43 +01:00
Yukihiro "Matz" Matsumoto
100f0e6759
Do not need to take target_class from the upper proc.
...
Since it is already set in `mrb_proc_new()`.
2017-12-20 19:37:26 +09:00
Yukihiro "Matz" Matsumoto
73b05f0130
Should not overwrite MRB_PROC_TARGET_CLASS(p) if p has env; fix #3905
2017-12-20 19:37:26 +09:00
Yukihiro "Matz" Matsumoto
165e7b181b
Fixed method look-up for method_missing in OP_SUPER; ref #3905
...
Method look-up for `OP_SUPER` should start from the superclass of
the `target_class` but if it fails, the look-up for `method_missing`
should start from the class of the receiver.
The following code explains the case:
```ruby
class Bar
def foo
super
end
end
class Foo<Bar
def method_missing(mid, *)
p mid
end
end
```
Foo.new.foo
2017-12-20 19:37:26 +09:00
Yukihiro "Matz" Matsumoto
d0f60182af
The superclass info should be taken from `TARGET_CLASS(ci->proc).
...
Not from `ci->target_class` that may be switched using `class_eval` etc.
fix #3899 , fix #3906
We found out there is a mruby specific limitation that `super` may be
screwed up when a method is defined in a module and `super` is called
in the block with the target class switched (for example, `super` in
`class_eval` block). Now we raise `RuntimeError` for such cases.
The following code works in CRuby but not in mruby.
```
module M
def foo
"aaa".singleton_class.class_eval{super 2}
end
end
class Foo
def foo(*); end
end
class Bar<Foo
include M
end
Bar.new.foo
```
2017-12-20 10:34:54 +09:00
Yukihiro "Matz" Matsumoto
d9049c10fa
Merge pull request #3904 from ksss/mruby-method
...
Add mruby-method
2017-12-18 11:59:36 +09:00
Yukihiro "Matz" Matsumoto
bba6c9a1ce
Fix descriptor leakage; ref #3903
2017-12-18 11:55:12 +09:00
Yukihiro "Matz" Matsumoto
e5056d058a
Fix fptr leakage; ref #3903
2017-12-18 11:55:12 +09:00
Yukihiro "Matz" Matsumoto
83d02bcd5a
Use _dup2 instead of dup2 on Windows; ref #3903
2017-12-18 11:55:12 +09:00
Yukihiro "Matz" Matsumoto
5e22e8e350
open on Windows takes int 3rd argument instead of mode_t.
2017-12-18 11:15:27 +09:00
ksss
c0914dbb65
mruby/data.h doesn't need
2017-12-18 11:11:44 +09:00
Yukihiro "Matz" Matsumoto
b4dcb8f286
Use _dup instead of dup on Windows; ref #3903
2017-12-18 11:10:49 +09:00
ksss
615f296fcf
Clean up some files and docs
2017-12-18 11:10:10 +09:00
ksss
ae786b18d5
Shouldn't use alloca
2017-12-18 11:05:55 +09:00
Yukihiro "Matz" Matsumoto
a510564d6d
Merge pull request #3903 from ksss/io-dup
...
Implement IO#initialize_copy
2017-12-18 10:58:12 +09:00
ksss
b83ff8ccd8
Add mrbgems/mruby-method
...
from https://github.com/ksss/mruby-method/commit/0837a0b507a5b4cdf8a1f1039ee371cee4e3b7fb
2017-12-18 10:54:37 +09:00
ksss
35185e69bf
Implement IO#initialize_copy
2017-12-17 18:02:37 +09:00
Yukihiro "Matz" Matsumoto
ddb1aae41d
Need to set ci->proc before calling methods; fix #3902
2017-12-16 09:33:37 +09:00
Yukihiro "Matz" Matsumoto
03614ed918
Need to clear exception handler on return; fix #3898
2017-12-16 09:17:07 +09:00
Yukihiro "Matz" Matsumoto
05129ab9b3
Check if destinations are too distant; fix #3900 fix #3901
2017-12-15 17:57:45 +09:00
Yukihiro "Matz" Matsumoto
7ecb96a00a
Merge pull request #3897 from mimaki/initialize-is_socket
...
Initialized mrb_io.is_socket
2017-12-14 13:58:27 +09:00
Hiroshi Mimaki
41039524a9
Initialized mrb_io.is_socket
2017-12-14 12:36:25 +09:00
Yukihiro "Matz" Matsumoto
5b304c156c
On Windows, _S_IREAD and _S_IWRITE is defined in sys/stat.h.
2017-12-14 01:19:44 +09:00
Yukihiro "Matz" Matsumoto
7ac39333b5
Use _open and _close on Windows.
2017-12-14 01:19:21 +09:00
Yukihiro "Matz" Matsumoto
ebf49932c7
Merge pull request #3895 from mattn/fix-mkstemp
...
fix mkstemp implementation for MSVC
2017-12-14 00:46:19 +09:00
Yasuhiro Matsumoto
e7e5db51de
fix mkstemp implementation for MSVC
2017-12-14 00:43:38 +09:00
Yukihiro "Matz" Matsumoto
f0379c8c45
Merge pull request #3892 from mimaki/ipproto-winsock
...
Use IPPROTO enum values on WinSock.
2017-12-14 00:09:45 +09:00
Yukihiro "Matz" Matsumoto
16e473caad
Rename BasicSocket#is_socket= to #_is_socket; ref #3878
2017-12-14 00:07:42 +09:00
Yukihiro "Matz" Matsumoto
69ad12de06
Exclude UNIXSocket tests again; ref #3878
2017-12-14 00:05:23 +09:00
Takeshi Watanabe
d2163d13a8
Declare super class in socket.rb.
2017-12-14 00:05:23 +09:00
Takeshi Watanabe
949bf6ca43
Fix socket closing by using closesocket API in windows instead.
2017-12-14 00:05:23 +09:00
Yukihiro "Matz" Matsumoto
2300c9f737
Merge pull request #3893 from mimaki/add-mrbgem-summary
...
Added mrbgem's summary.
2017-12-14 00:00:10 +09:00
Yukihiro "Matz" Matsumoto
dc5de38414
Merge pull request #3894 from mattn/mirb-locale
...
fix locale message in mirb
2017-12-13 23:11:49 +09:00
Yukihiro "Matz" Matsumoto
1a150a6e48
Merge pull request #3891 from mimaki/set-addrinfo-protocol
...
Set protocol of AddrInfo
2017-12-13 23:00:25 +09:00
Yasuhiro Matsumoto
0ab9ac6b22
fix locale in mirb
2017-12-13 22:28:18 +09:00
Hiroshi Mimaki
584e4e413a
Added mrbgem's summary.
2017-12-13 16:05:06 +09:00
Hiroshi Mimaki
9fac1a3f8b
Use IPPROTO enum values on WinSock.
2017-12-13 15:58:23 +09:00
Hiroshi Mimaki
398da99d05
Set protocol of AddrInfo
2017-12-13 14:44:13 +09:00
Yukihiro "Matz" Matsumoto
55fced30cd
Use _tempnam instead of tempnam on Windows.
2017-12-13 14:17:49 +09:00
Yukihiro "Matz" Matsumoto
a3925f3dec
Merge pull request #3889 from mattn/fix-crash
...
fix crash bug on Windows
2017-12-13 14:10:44 +09:00
Yukihiro "Matz" Matsumoto
aec65f2605
Merge pull request #3890 from mimaki/mruby-socket-windows-test
...
Skip tests on Windows platform
2017-12-13 13:59:28 +09:00
Hiroshi Mimaki
4353623b72
Skip tests on Windows platform
2017-12-13 13:02:59 +09:00
Yasuhiro Matsumoto
6123d653b7
fix crash bug on Windows
2017-12-13 12:48:26 +09:00
Yukihiro "Matz" Matsumoto
fa33bd86a8
Remove VC++ compiler warnings.
2017-12-13 11:39:32 +09:00
Yukihiro "Matz" Matsumoto
7d940e3682
Merge pull request #3888 from mattn/fix-locale
...
fix path locales
2017-12-13 10:24:52 +09:00
Yasuhiro Matsumoto
16c2ac2588
fix path locales
2017-12-13 10:12:59 +09:00
Yukihiro "Matz" Matsumoto
e14387440e
Skip test/t/float.rb tests; ref #3827
2017-12-13 08:45:46 +09:00
Yukihiro "Matz" Matsumoto
11b6696ce2
Retrieve operands at the beginning of OP_SCLASS.
2017-12-13 08:43:15 +09:00
Yukihiro "Matz" Matsumoto
e647b16d1d
Should not define Float class in mrblib/00class.rb; ref #3828
...
Unless it is defined in `numeric.c`.
2017-12-13 08:42:07 +09:00
Yukihiro "Matz" Matsumoto
ad06781107
Fixed wrong MRB_WITHOUT_FLOAT condition; ref #3827
2017-12-13 08:38:34 +09:00
Yukihiro "Matz" Matsumoto
c66978521d
Reduce VC++ type mismatch warnings.
2017-12-13 08:10:35 +09:00
Yukihiro "Matz" Matsumoto
5a5adafabf
Merge pull request #3886 from mattn/io-windows
...
implement popen/flock on Windows
2017-12-13 07:56:24 +09:00
Yasuhiro Matsumoto
b07269584c
fix build for MSVC
2017-12-13 00:21:30 +09:00
Yasuhiro Matsumoto
e0e23b1765
close file descriptors
2017-12-13 00:18:02 +09:00
Yasuhiro Matsumoto
7c8c9f9532
mingw have mkstemp
2017-12-13 00:08:10 +09:00
Yasuhiro Matsumoto
7ff907f680
fix test
2017-12-13 00:07:51 +09:00
Yasuhiro Matsumoto
f1ea7a31c0
implement flock on Windows
2017-12-12 23:21:41 +09:00
Yasuhiro Matsumoto
df2c3771f8
fix compilation error
2017-12-12 22:39:21 +09:00
Yasuhiro Matsumoto
f6f8bb2416
fix compilation error
2017-12-12 22:39:20 +09:00
Yasuhiro Matsumoto
06ec17de60
add definition for pid_t on MSVC
2017-12-12 22:39:19 +09:00
Yasuhiro Matsumoto
d549603a8a
close handle
2017-12-12 22:39:18 +09:00
Yasuhiro Matsumoto
b8ca0b7cd8
implement popen on Windows
2017-12-12 22:39:17 +09:00
Yukihiro "Matz" Matsumoto
c863e0dac8
Merge pull request #3885 from Shokuji/cygwin_mruby_io_test
...
fixed mruby-io so that the test passes on cygwin
2017-12-12 22:34:10 +09:00
Yukihiro "Matz" Matsumoto
c6ea948030
Revert "Update .travis.yml to use gcc-6"
...
This change caused Travis CI errors on OSX. This reverts
commit c76631d445 .
2017-12-12 22:31:14 +09:00
Yukihiro "Matz" Matsumoto
346ebfb0ea
Merge pull request #3882 from mattn/fix-filename
...
use filename in locale
2017-12-12 22:27:25 +09:00
Yukihiro "Matz" Matsumoto
25bee356b1
Merge pull request #3884 from mimaki/mruby-io-test-on-windows
...
Fixed mruby-io test failure on Windows platform.
2017-12-12 22:21:08 +09:00
Yasuhiro Matsumoto
17cd7a65e7
fix wrong variable name
2017-12-12 18:52:41 +09:00
Yasuhiro Matsumoto
bceb6640fa
fix compilation error
2017-12-12 18:52:41 +09:00
Yasuhiro Matsumoto
977f79478f
use filename in locale
2017-12-12 18:52:40 +09:00
Yukihiro "Matz" Matsumoto
bbb0882343
Modifying frozen objects will raise FrozenError.
...
`FrozenError` is a subclass of `RuntimeError` which used to be
raised. [Ruby2.5]
2017-12-12 18:41:18 +09:00
Yukihiro "Matz" Matsumoto
d4ff92bcf6
Do not use FIXABLE when mrb_int is big enough.
2017-12-12 17:45:15 +09:00
Yukihiro "Matz" Matsumoto
3d98fa2e46
Reduce type mismatch warnings in pack.c.
2017-12-12 17:45:15 +09:00
Yukihiro "Matz" Matsumoto
a5b8603aa2
Winsock uses int where UNIX uses size_t.
2017-12-12 17:45:15 +09:00
Yukihiro "Matz" Matsumoto
a9e434e69a
Merge pull request #3883 from mattn/fix-ssize_t
...
fix build on mingw
2017-12-12 17:31:26 +09:00
窪山 翔士
e71a6a7b2c
fixed mruby-io so that the test passes on cygwin
2017-12-12 17:29:05 +09:00
Hiroshi Mimaki
5ef8f18e9b
Fixed mruby-io test failure on Windows platform.
2017-12-12 16:57:13 +09:00
Yasuhiro Matsumoto
99328695e3
fix build on mingw
2017-12-12 16:47:34 +09:00
Yukihiro "Matz" Matsumoto
9c0426c990
Winsock does not provide ssize_t; Use int instead.
2017-12-12 09:52:39 +09:00
Yukihiro "Matz" Matsumoto
2db06c471e
Revert "Update .travis.yml"
...
This reverts commit f73ac4112f .
This change caused Travis errors.
2017-12-12 09:49:26 +09:00
Yukihiro "Matz" Matsumoto
08a508cbee
Fixed the mixture of int and long in mruby-pack.
2017-12-12 09:48:53 +09:00
Yukihiro "Matz" Matsumoto
5bf60b4837
Merge pull request #3881 from mame/mrb_without_float-for-mruby-io-and-mruby-pack
...
Support MRB_WITHOUT_FLOAT to mruby-io and mruby-pack
2017-12-12 07:49:30 +09:00
Yusuke Endoh
d96b2c9a76
Support MRB_WITHOUT_FLOAT to mruby-io and mruby-pack
2017-12-12 00:47:56 +09:00
Yukihiro "Matz" Matsumoto
85fc9b88d0
Merge pull request #3880 from mruby/matz-patch-1
...
Update .travis.yml
2017-12-11 23:23:10 +09:00
Yukihiro "Matz" Matsumoto
f73ac4112f
Update .travis.yml
2017-12-11 22:17:30 +09:00
Yukihiro "Matz" Matsumoto
0e452a75ac
Update .travis.yml
2017-12-11 19:36:52 +09:00
Yukihiro "Matz" Matsumoto
b763759972
Reduce VC++ compiler warnings.
2017-12-11 17:22:46 +09:00
Yukihiro "Matz" Matsumoto
c76631d445
Update .travis.yml to use gcc-6
...
The patch is created by @take_cheese in #3872
2017-12-11 17:19:49 +09:00
Yukihiro "Matz" Matsumoto
6d42195fb2
Add enable_sanitizer method for clang and gcc.
...
The patch is created by @take_cheese in #3872
2017-12-11 17:14:50 +09:00
Yukihiro "Matz" Matsumoto
274884abe5
Reduce VC++ compiler warnings.
2017-12-09 16:14:12 +09:00
Yukihiro "Matz" Matsumoto
761218e70b
Skip socket tests on Windows platform.
...
Some test may be OK but we skip everything as a starting point.
2017-12-09 14:22:53 +09:00
Yukihiro "Matz" Matsumoto
b103fa229d
File.symlink may not be implemented on some platforms; ref #3877
2017-12-09 14:22:03 +09:00
Yukihiro "Matz" Matsumoto
bda273f35d
Merge pull request #3877 from bamchoh/patch-3
...
Skip "File.readlink fails" test on MSVC
2017-12-09 14:16:20 +09:00
Yukihiro "Matz" Matsumoto
6bc38f4637
Merge pull request #3876 from bamchoh/patch-2
...
Use same format between Fail and Skip
2017-12-09 13:15:10 +09:00
bamchoh
0ded91c806
Skip "File.readlink fails" test on MSVC
...
When MSVC, "File.readlink fails with non-symlink" test was failed even if raising NotImplementedError
2017-12-09 03:27:05 +09:00
bamchoh
81dc383291
Use same format between Fail and Skip
...
We can see gem name in skip message by this fix
2017-12-09 02:12:37 +09:00
Yukihiro "Matz" Matsumoto
550c878216
Use RL_READLINE_VERSION to determine rl_free existence; fix #3875
2017-12-08 21:49:12 +09:00
Yukihiro "Matz" Matsumoto
e17092debd
Merge pull request #3874 from mimaki/fix-mingw-compile-error
...
Fixed compile error of `mruby-io` gem on MinGW.
2017-12-08 14:34:10 +09:00
Yukihiro "Matz" Matsumoto
c47a1984b4
Merge pull request #3873 from take-cheeze/fix_socket_test_leak
...
Fix memory leak found by leak sanitizer.
2017-12-08 14:33:49 +09:00
Hiroshi Mimaki
7f3bda5653
Fixed compile error of mruby-io gem on MinGW.
2017-12-08 12:58:26 +09:00
Takeshi Watanabe
5de7dc2948
Fix memory leak found by leak sanitizer.
2017-12-08 12:10:28 +09:00
Yukihiro "Matz" Matsumoto
83065df67a
Reduce compiler warnings from mruby-io gem.
2017-12-08 10:07:41 +09:00
Yukihiro "Matz" Matsumoto
f9d1d72217
Avoid VC++ reserved word template.
2017-12-08 09:55:55 +09:00
Yukihiro "Matz" Matsumoto
36a0b864ba
Reduce VC++ compiler warnings.
2017-12-08 09:50:02 +09:00
Yukihiro "Matz" Matsumoto
f1207573bd
Uninitialized value returned.
2017-12-08 09:50:02 +09:00
Yukihiro "Matz" Matsumoto
6ebcb7417a
AppVeyor compile errors resolution.
2017-12-08 09:37:50 +09:00
Yukihiro "Matz" Matsumoto
9df7bceb15
AppVeyor compiler does not proved some POSIX functions.
...
- `mode_t` by `int`
- `umask` by `_umask`
- `rmdir` by `_rmdir`
- `mkstemp` and `mkdtemp` by using `_mktemp`
2017-12-08 09:19:59 +09:00
Yukihiro "Matz" Matsumoto
b724e06cf2
Avoid uninitialized local variables in mruby-pack.
2017-12-07 20:28:30 +09:00
Yukihiro "Matz" Matsumoto
bc9e3e6fd0
Add type cast to readline(2) return value.
2017-12-07 20:26:34 +09:00
Yukihiro "Matz" Matsumoto
764a568aa4
Remove unused variable usock from mruby-socket/src/socket.c.
2017-12-07 20:25:40 +09:00
Yukihiro "Matz" Matsumoto
ff1194c134
fixup! Fix type casting errors when mruby-socket compiled by C++.
2017-12-07 20:24:13 +09:00
Yukihiro "Matz" Matsumoto
a5412d48fd
Add 'mrbgems/mruby-pack/' from commit '383a9c79e191d524a9a2b4107cc5043ecbf6190b'
...
git-subtree-dir: mrbgems/mruby-pack
git-subtree-mainline: 842e6945f2
git-subtree-split: 383a9c79e1
2017-12-07 18:35:09 +09:00
Yukihiro "Matz" Matsumoto
842e6945f2
Fix type casting errors when mruby-socket compiled by C++.
...
Also `bool` is a reserved word in C++.
2017-12-07 18:23:01 +09:00
Yukihiro "Matz" Matsumoto
73ef548c63
Add 'mrbgems/mruby-socket/' from commit 'ab54185005ec87fe4f5b10df95ad29659884141b'
...
git-subtree-dir: mrbgems/mruby-socket
git-subtree-mainline: d75266dd1b
git-subtree-split: ab54185005
2017-12-07 18:11:13 +09:00
Yukihiro "Matz" Matsumoto
d75266dd1b
Add 'mrbgems/mruby-io/' from commit '3c8e1f94c44252c836f79a48bb17726da28e2756'
...
git-subtree-dir: mrbgems/mruby-io
git-subtree-mainline: 10ed730e4b
git-subtree-split: 3c8e1f94c4
2017-12-07 18:11:06 +09:00
Yukihiro "Matz" Matsumoto
10ed730e4b
Cancel df3507660 that does not do any good.
2017-12-07 15:18:41 +09:00
Yukihiro "Matz" Matsumoto
cdf173d32c
Avoid updating to reallocated stack in OP_RETURN; fix #3870
...
The code was introduced to address #3175 but it's no longer needed.
2017-12-07 15:05:14 +09:00
Yukihiro "Matz" Matsumoto
0e46b14b9e
The ci should not be equal to cibase with OP_R_BREAK; #3871
2017-12-06 17:28:20 +09:00
Yukihiro "Matz" Matsumoto
6975258efd
The proc with top-level env must be 'proc-closure'; fix #3871
2017-12-06 17:28:20 +09:00
Yukihiro "Matz" Matsumoto
ae44e80668
Limit ecall() depth to 32 (default).
2017-12-06 17:28:20 +09:00
Yukihiro "Matz" Matsumoto
b00d45b095
mrb_method_search_vm() should gives the defined class.
...
Otherwise `super` may call a wrong method.
2017-12-06 17:28:20 +09:00
Yukihiro "Matz" Matsumoto
4a99f4949e
Need to set ci->proc when we have RProc structure.
...
Mentioned in https://qiita.com/bamchoh/items/eabebbbb330cb0e0470a
2017-12-05 11:43:12 +09:00
Yukihiro "Matz" Matsumoto
cbb6f29875
Merge pull request #3868 from bamchoh/patch-1
...
Revise MRB_METHOD_PROC macro's argument
2017-12-05 06:47:22 +09:00
bamchoh
940133b627
Revise MRB_METHOD_PROC macro's argument
...
I revised MRB_METHOD_PROC macro's argument fn to m.
2017-12-05 01:22:43 +09:00
Yukihiro "Matz" Matsumoto
1fea63429e
Some OS uses libedit that does not provide rl_free().
...
`libedit` is a `readline` compatible library with BSD license.
2017-12-04 11:53:19 +09:00
Yukihiro "Matz" Matsumoto
0b5d97ec42
Need to unshare env stack on break; fix #3866
2017-12-04 10:15:12 +09:00
Yukihiro "Matz" Matsumoto
6f4d4bbcc7
Remove temporary objects from GC arena in `mrb_vformat()'; #3863
2017-12-04 08:56:11 +09:00
Yukihiro "Matz" Matsumoto
5d04e3316b
Check if ci->proc is not NULL and MRB_PROC_CFUNC_P(); fix #3867
2017-12-04 08:56:11 +09:00
Yukihiro "Matz" Matsumoto
ff8b608c52
Free read lines using the deallocation function from the library.
...
To avoid potential `malloc/free` mismatch.
2017-12-04 08:56:11 +09:00
Yukihiro "Matz" Matsumoto
cd9f53d42e
Pop exception objects from the bottom of GC arena; fix #3863
2017-12-04 08:56:11 +09:00
Yukihiro "Matz" Matsumoto
c35a402676
The stack shift width should be determined by p->upper; fix #3864
...
And check required register number from `ci->proc` as well.
The fixes for #3859 and #3862 were incomplete.
2017-12-01 10:01:46 +09:00
Yukihiro "Matz" Matsumoto
86ef9a2806
Avoid calling mrb_env_unshare() when env is NULL.
...
Small performance improvement by reducing function invocations.
2017-11-30 08:19:38 +09:00
Yukihiro "Matz" Matsumoto
2b9f762ba1
Avoid double free() of env stack; fix #3860
...
Should turn on `MRB_ENV_STACK_UNSHARED` flag only after env stack
reallocation. `malloc()` may fail.
2017-11-30 08:17:14 +09:00
Yukihiro "Matz" Matsumoto
d3e273ba4e
Wrong stack adjustment in ecall() ( f35f975 #3859 ); fix #3862
2017-11-30 08:04:27 +09:00
Yukihiro "Matz" Matsumoto
f3279b41e6
Stop infinite recursion in Class#to_s; fix #3861
2017-11-30 07:58:11 +09:00
Yukihiro "Matz" Matsumoto
5f7cdecdc9
Clear c->prev on fiber termination.
2017-11-29 20:25:55 +09:00
Yukihiro "Matz" Matsumoto
b746a0f0d2
Need to free contexts when freeing fibers.
...
Memory leak fixed; ref #3711
2017-11-29 20:24:03 +09:00
Yukihiro "Matz" Matsumoto
9c78a9bfa2
Set MRB_FIBER_TERMINATED flag on exception termination of a fiber.
2017-11-29 20:17:33 +09:00
Yukihiro "Matz" Matsumoto
b7c3a876f1
Add most recent call last message to the backtrace.
2017-11-29 16:56:10 +09:00
Yukihiro "Matz" Matsumoto
3e67a116d1
Call all ensure clauses pushed at OP_STOP.
2017-11-29 12:16:16 +09:00
Yukihiro "Matz" Matsumoto
afa53809e2
No need to use ecall_adjust().
2017-11-29 12:15:24 +09:00
Yukihiro "Matz" Matsumoto
f35f975d26
Fixed stack address adjustment in ecall(); fix #3859
2017-11-29 12:14:05 +09:00
Yukihiro "Matz" Matsumoto
d4fc980527
Need to evaluate ensure clauses at fiber termination.
2017-11-29 11:57:33 +09:00
Yukihiro "Matz" Matsumoto
6bb5ad786c
Remove unnecessary code; ref #3711
2017-11-29 11:44:07 +09:00
Yukihiro "Matz" Matsumoto
597149ae23
Change newline style of test/t/lang.rb (from DOS)
2017-11-22 16:10:28 +09:00
Yukihiro "Matz" Matsumoto
b4f9b031de
Some cosmetic changes
2017-11-22 16:09:50 +09:00
Yukihiro "Matz" Matsumoto
284a1d12ee
Provide shortcut comparison methods for numbers for performance.
2017-11-22 15:43:48 +09:00
Yukihiro "Matz" Matsumoto
0ab21a9a5e
Stack adjustment should be based on p->upper; fix #3857
...
It used to be based on `ci->proc` but the callinfo position may be
wrong when `ecall()` is called during stack rewinding from `OP_RETURN`.
2017-11-22 14:05:11 +09:00
Yukihiro "Matz" Matsumoto
fbafa78098
Clear ensure stack after calling in OP_EPOP; #3855 3856
2017-11-22 12:22:45 +09:00
Yukihiro "Matz" Matsumoto
4665b07f7b
No need to pop ensure stack if eidx is smaller than epos; #3855 #3856
2017-11-22 12:21:24 +09:00
Yukihiro "Matz" Matsumoto
fe3ac50845
fixup! Remove fixed argument of ecall(); ref #3855 #3856
2017-11-22 12:20:56 +09:00
Yukihiro "Matz" Matsumoto
cb4b042777
Remove fixed argument of ecall(); ref #3855 #3856
2017-11-22 12:19:40 +09:00
Yukihiro "Matz" Matsumoto
393133e741
Should have marked all ensure stack entries; fix #3855 fix #3856
2017-11-22 12:18:20 +09:00
Yukihiro "Matz" Matsumoto
8b7a8978e2
Reduce the size of struct RBreak to reduce memory usage.
...
The old size of `struct RBreak` was 56 bytes (`MRB_NO_BOXING`)
and it's bigger than other object structures. That increase the
size of `RVALUE` thus increase the total amount of memory consumption.
2017-11-20 18:33:41 +09:00
Yukihiro "Matz" Matsumoto
8f2c62407c
Add MRB_METHOD_TABLE_INLINE option.
...
Now the method tables (in classes/modules and caches) keeps C function
pointers without wrapping in `struct RProc` objects. For the sake of
portability, `mrb_method_t` is represented by the struct and union, but
if the most significant bit of the pointer is not used by the platform,
`mrb_method_t` should be packed in `uintptr_t` to reduce memory usage.
`MRB_METHOD_TABLE_INLINE` is turned on by default for linux.
2017-11-20 18:33:41 +09:00
Yukihiro "Matz" Matsumoto
6c06e77446
Add MRB_METHOD_CACHE description to include/mrbconf.h
2017-11-20 06:04:27 +09:00
Yukihiro "Matz" Matsumoto
6a9efd6849
Invoke mrb_full_gc() before ObjectSpace.count_objects.
2017-11-19 12:19:46 +09:00
Yukihiro "Matz" Matsumoto
9b2454c94d
Leave hash->ht to be NULL if initial capacity is zero.
2017-11-19 03:46:58 +09:00
Yukihiro "Matz" Matsumoto
7405821f5a
doc/limitaions.md: Remove infinite recursion entry.
...
It's fixed since 1.3.0
2017-11-18 21:16:22 +09:00
Yukihiro "Matz" Matsumoto
86f9254df0
doc/limitaions.md: Remove Kernel.binding entry.
...
Since no ISO classes/methods are not provided by mruby, there's
no use mentioning `Kernel.binding` here.
2017-11-18 21:14:19 +09:00
Yukihiro "Matz" Matsumoto
825e93eba4
Assign operands to local variables.
2017-11-18 00:03:59 +09:00
Yukihiro "Matz" Matsumoto
31ce73ddc3
Merge pull request #3853 from ukrainskiysergey/variable_c_cosmetic_changes
...
Removed useless condition
2017-11-18 00:03:50 +09:00
Ukrainskiy Sergey
a2d0ee59c6
Removed useless condition
2017-11-17 22:30:22 +09:00
Yukihiro "Matz" Matsumoto
269f9f2125
Merge pull request #3852 from dabroz/feature-array-transpose
...
implement Array.transpose
2017-11-17 21:50:34 +09:00
Tomasz Dąbrowski
e65fa4d7a2
implement Array.transpose
2017-11-17 12:39:34 +01:00
Yukihiro "Matz" Matsumoto
d01003ce3a
Merge pull request #3851 from ukrainskiysergey/variable_c_cosmetic_changes
...
Cosmetic changes in variable.c
2017-11-17 20:04:37 +09:00
Ukrainskiy Sergey
ddd32d74e1
Changed the assignment of a variable in variable.c
2017-11-17 19:43:57 +09:00
Ukrainskiy Sergey
74714c8fee
Changed numbers to TRUE and FALSE for mrb_bool in variable.c
2017-11-17 19:16:29 +09:00
Yukihiro "Matz" Matsumoto
c8da602752
Need to save stack space by number of registers from the current proc,
...
Not from the execution ensure proc; fix #3849
2017-11-17 01:08:46 +09:00
Yukihiro "Matz" Matsumoto
03a3bd9178
The number of argument should be retrieved by mrb_get_argc; fix #3848
...
You should not access `mrb->c->ci->argc` directly.
2017-11-13 16:16:38 +09:00
Yukihiro "Matz" Matsumoto
c210a8adf9
Fixed wrong stack extend size; fix #3847
2017-11-11 17:55:32 +09:00
Yukihiro "Matz" Matsumoto
181f980b6c
Need to clear stack region for local variables in eval; fix #3844
2017-11-10 21:53:12 +09:00
Yukihiro "Matz" Matsumoto
41c8c419cf
Use proper target_class to define class/module; fix #3843
...
The outer class of the class/module definition should be taken from
`MRB_TARGET_CLASS(mrb->c->ci->proc)` not `mrb->c->ci->target_class`
which is the target of constant lookups.
2017-11-09 00:14:21 +09:00
Yukihiro "Matz" Matsumoto
f723832ebc
Should allocate memory region before updating len; fix #3842
...
Otherwise half-baked string object will be allocated.
2017-11-08 08:46:55 +09:00
Yukihiro "Matz" Matsumoto
7ae20e0785
Simplify MRB_WITHOUT_FLOAT condtion
2017-11-08 08:45:59 +09:00
Yukihiro "Matz" Matsumoto
37f6e42293
Removed redundant function prototype.
2017-11-04 17:59:00 +09:00
Yukihiro "Matz" Matsumoto
d6cb4f9cf2
Merge branch 'pandax381-mrb_without_float'
2017-11-04 12:33:07 +09:00
Yukihiro "Matz" Matsumoto
a751f7f196
Make mirb to print warnings; ref #3827
2017-11-04 12:32:34 +09:00
Yukihiro "Matz" Matsumoto
fef4b394a7
Avoid compiling fmt_fp.c if MRB_WITHOUT_FLOAT is set; #3827
2017-11-04 12:12:52 +09:00
Yukihiro "Matz" Matsumoto
de2363a9f0
Merge branch 'mrb_without_float' of https://github.com/pandax381/mruby into pandax381-mrb_without_float
2017-11-04 11:49:25 +09:00
Yukihiro "Matz" Matsumoto
388d26d770
Reimplement block_given?; ref #3841
...
Make `block_given?` to search for the top of the scope first.
The top of the scope means either:
* the top method body
* the enclosing class body
* the top-level
The special case is the method defined by `define_method` with a
block as in #3841 . In cases like this, the method body (given by
a block) is not considered as the top of the scope. You need to use
`&block` in the block parameter if you want to know if a block is
given to the method.
This commit also changes the behavior of `MRB_PROC_SCOPE` flag.
Now it is only set if the `proc` is either a class body or a method
body defined in Ruby. It is no longer set for a block that given to
`define_method`.
2017-11-04 11:20:04 +09:00
Yukihiro "Matz" Matsumoto
ab27abe083
The bidx saved in env may be useless; fix #3841
...
When `block_given?` is called from a block given to `define_method`
as a method body, the `bidx` may not be within `env` saved closure.
In this case, it causes heap buffer overflow.
2017-11-04 03:01:37 +09:00
YAMAMOTO Masaya
625f9f6fa3
Merge branch 'master' of github.com:mruby/mruby
2017-11-04 01:23:12 +09:00
Yukihiro "Matz" Matsumoto
e7fe6ee263
Avoid pointer arithmetic in backtrace.c; #3816
2017-11-04 00:35:50 +09:00
Yukihiro "Matz" Matsumoto
12e38597c8
Always check division-by-zero to avoid undefined behavior; fix #3816
...
Also removed the code to normalize NaN value for `MRB_NAN_BOXING`.
Tha code was added to fix #1712 but no longer required after 249f05e7d .
2017-11-03 09:35:55 +09:00
Yukihiro "Matz" Matsumoto
d489b41c31
Reduce memory leaks from mirb.
2017-11-03 08:24:47 +09:00
Yukihiro "Matz" Matsumoto
e4662d77e7
Should not use FSHARED state for string from irep pools; fix #3829
...
This strings in `irep` pools may be freed forcefully in `mrb_irep_free`.
This commit probably fixes #3817 as well.
2017-11-03 08:24:47 +09:00
Yukihiro "Matz" Matsumoto
13a318b0c7
Merge pull request #3840 from iij/keep-backtrace-rethrown-exc
...
don't strip away backtrace info when an exception is re-thrown
2017-11-02 21:36:26 +09:00
Tomoyuki Sahara
f6896751b4
don't overwrite backtrace info.
2017-11-02 15:44:05 +09:00
Yukihiro "Matz" Matsumoto
ddfb24908c
Fixed constant (and class variable) reference bug; fix #3839
...
Unlike method definition, constant reference should start from
`MRB_PROC_TARGET_CLASS(ci->proc)`, not `ci->target_class`.
In addition, `MRB_PROC_TARGET_CLASS(ci->proc)` is always set.
2017-10-31 09:10:08 +09:00
Yukihiro "Matz" Matsumoto
022570ab8d
Call stack may not reference the destination proc; fix #3838
...
The destination `proc` may be an orphan.
2017-10-31 09:10:08 +09:00
Yukihiro "Matz" Matsumoto
b6598e052f
Need to mark fibers referenced from env; fix #3837
...
The issue #3837 is a regression of #3819 . I was mistakenly removed
a important code to mark fibers from `env`.
2017-10-31 09:10:08 +09:00
Yukihiro "Matz" Matsumoto
77edafb04c
Need to check number of argument of Struct#new; fix #3823
2017-10-29 00:25:45 +09:00
Yukihiro "Matz" Matsumoto
59dc7d0763
Removed a debug printf; fix #3834
2017-10-28 23:39:21 +09:00
Yukihiro "Matz" Matsumoto
1b45e034ba
Remove one of the lines that did the same thing; fix #3836
...
The change is suggested by `ukrainskiysergey` in #3836 .
I deleted the other line for clarity. I also updated comment lines.
2017-10-28 23:35:01 +09:00
Yukihiro "Matz" Matsumoto
6316e0c75d
Should clear ensure stack at OP_RETURN break; #3715
...
This is a resurrection of d0a7e01 , which is accidentally
removed by 93f5f22; Fix #3715
2017-10-28 23:27:07 +09:00
Yukihiro "Matz" Matsumoto
92e24f809b
Should check if callinfo stack is popped before updating the stack.
...
This is a resurrection of 75c374c , which is accidentally removed by
93f5f22; Fix #3507 #3512 #3518 #3521
2017-10-28 23:10:28 +09:00
Yukihiro "Matz" Matsumoto
c7c9543bed
Fixed UPVAR gotchas; fix #3835
...
Both `uvenv` function and `env` generation in `create_proc_from_string`
function have bugs to handling enclosed environment objects.
2017-10-28 23:08:31 +09:00
Yukihiro "Matz" Matsumoto
57dad6e3fd
Remove a debug variable
2017-10-28 01:37:51 +09:00
Yukihiro "Matz" Matsumoto
23d18bbd62
Add parentheses to pacify a warning.
2017-10-28 01:32:25 +09:00
Yukihiro "Matz" Matsumoto
93f5f22577
Heavily refactored how lexical scope links are implemented; fix #3821
...
Instead of `irep` links, we added a `upper` link to `struct RProc`.
To make a space for the `upper` link, we moved `target_class` reference.
If a `Proc` does not have `env`, `target_class` is saved in an `union`
shared with `env` (if a `Proc` has env, you can tell it by `MRB_PROC_ENV_P()).
Otherwise `target_class` is referenced from `env->c`. We removed links
in `env` as well.
This change removes 2 members from `mrb_irep` struct, thus saving 2
words per method/proc/block. This also fixes potential memory leaks
due to the circular references caused by a link from `mrb_irep`.
2017-10-28 00:29:30 +09:00
Yukihiro "Matz" Matsumoto
3f9d00ded3
comment out bench build from standard build_config.rb
2017-10-28 00:29:30 +09:00
Yukihiro "Matz" Matsumoto
4614b9d632
remove inline from replacement memcpy&memset
2017-10-28 00:29:30 +09:00
Yukihiro "Matz" Matsumoto
5405b47f41
Update test for Kernel#local_variables
2017-10-28 00:29:30 +09:00
Yukihiro "Matz" Matsumoto
14877469d1
Remove MRB_API from mrb_env_unshare()
2017-10-28 00:29:30 +09:00
Yukihiro "Matz" Matsumoto
07cf7b16f3
Add some peephole optimizations
2017-10-28 00:29:30 +09:00
Yukihiro "Matz" Matsumoto
6c966a1f86
Change the order of "expected" and "actual" in test
2017-10-28 00:29:30 +09:00
Yukihiro "Matz" Matsumoto
0cf5a0ee37
Use alias to implement attr method
2017-10-28 00:29:30 +09:00
Yukihiro "Matz" Matsumoto
fda64be996
Flush stdout after every print from tests
2017-10-28 00:29:30 +09:00
Yukihiro "Matz" Matsumoto
71eeb86a99
Format codedump for OP_{LE,LT,GE,GT}.
2017-10-28 00:29:30 +09:00
Yukihiro "Matz" Matsumoto
d08205b40d
Merge pull request #3833 from bggd/appveyor_winbison_ruby24
...
Appveyor Improvements
2017-10-25 00:31:44 +09:00
bggd
7f4cc0de51
Turn on method cache for AppVeyor CI
2017-10-24 21:39:05 +09:00
bggd
7a13e89509
Use Ruby 2.4 instead of AppVeyor's Default(Ruby 1.9)
2017-10-24 21:37:36 +09:00
bggd
8a9b6c4352
Use win_bison instead of Cygwin's bison. Use YACC environment variable instead of global PATH
2017-10-24 21:31:37 +09:00
Yukihiro "Matz" Matsumoto
0c3ee0ba66
Add `Array#{permutation,combination}.
2017-10-20 10:38:58 +09:00
Yukihiro "Matz" Matsumoto
f2394859e3
Add main.define_method
2017-10-19 10:39:06 +09:00
Tomoyuki Sahara
3c8e1f94c4
Merge pull request #94 from kazuho/kazuho/rename-compatibility
...
make `rename` behavior consistent with MRI
2017-10-18 13:22:22 +09:00
Yukihiro "Matz" Matsumoto
fc930700b7
Add Kernel#itself; CRuby2.2
2017-10-18 10:21:54 +09:00
Yukihiro "Matz" Matsumoto
ce916b99b8
Add Hash#to_proc; CRuby2.3
2017-10-18 10:18:43 +09:00
Yukihiro "Matz" Matsumoto
b5dfbce767
Add Numeric#{positive?,negative?}; CRuby2.3
2017-10-18 10:10:37 +09:00
Yukihiro "Matz" Matsumoto
44f07045d1
Add Hash#fetch_values; CRuby2.3
2017-10-18 10:05:39 +09:00
Yukihiro "Matz" Matsumoto
913b83d579
Merge branch 'dabroz-fix-get-argc'
2017-10-17 15:24:00 +09:00
Yukihiro "Matz" Matsumoto
3c20c96f84
Use a new function: mrb_get_argc(); ref #3826
2017-10-17 15:23:32 +09:00
Yukihiro "Matz" Matsumoto
b890528a18
Remove mrb_vm_get_argc; ref #3826
2017-10-17 15:22:45 +09:00
Yukihiro "Matz" Matsumoto
344a7ce20c
Merge branch 'fix-get-argc' of https://github.com/dabroz/mruby into dabroz-fix-get-argc
2017-10-17 15:07:05 +09:00
Yukihiro "Matz" Matsumoto
4122c320bb
Add {String,Symbol}#casecmp?; CRuby2.4
2017-10-17 13:26:37 +09:00
Yukihiro "Matz" Matsumoto
db8265f428
Add Comparable#uniq; CRuby2.4
2017-10-17 12:46:51 +09:00
Yukihiro "Matz" Matsumoto
4e365156d1
Add Comparable#clamp; CRuby2.4
2017-10-17 11:19:12 +09:00
Yukihiro "Matz" Matsumoto
061d804a59
Add Numeric#{finite?,infinite?}; CRuby2.4
2017-10-17 11:19:12 +09:00
Yukihiro "Matz" Matsumoto
332d8d2a1c
Add String#delete_{prefix,suffix}; CRuby2.5
2017-10-17 11:19:12 +09:00
Yukihiro "Matz" Matsumoto
1519616ecb
Add Kernel#yield_self; CRuby2.5
2017-10-17 09:10:13 +09:00
Yukihiro "Matz" Matsumoto
c96def7c96
Remove top-level constant lookup; CRuby2.5
2017-10-17 08:45:06 +09:00
Yukihiro "Matz" Matsumoto
e59ad60327
do/end blocks to work with rescue/ensure/else; CRuby2.5
2017-10-17 08:17:31 +09:00
Yukihiro "Matz" Matsumoto
fb85855fa1
Add more checks before accessing struct pointer; ref #3831
2017-10-17 07:43:35 +09:00
Yukihiro "Matz" Matsumoto
be2c1592ed
Check struct-array pointer before accessing; fix #3831
2017-10-16 22:53:36 +09:00
Yukihiro "Matz" Matsumoto
1988bec23e
Need to adjust the stack length of the top-level environment; fix #3819
2017-10-16 22:35:25 +09:00
Yukihiro "Matz" Matsumoto
c3710dbb96
Fix a compile error on zero mrbgem case.
2017-10-16 18:46:15 +09:00
Yukihiro "Matz" Matsumoto
6b0c22e395
Merge pull request #3830 from dearblue/fix-alias-for-struct-accessors
...
fix alias for Struct accessors
2017-10-16 18:45:52 +09:00
YAMAMOTO Masaya
b70d69de09
Support MRB_WIHTOUT_FLOAT to mruby-kernel-ext
2017-10-16 18:15:47 +09:00
YAMAMOTO Masaya
9afd376fa4
Support MRB_WIHTOUT_FLOAT to mruby-object-ext
2017-10-16 18:15:25 +09:00
YAMAMOTO Masaya
b0cdb93a3a
Support MRB_WIHTOUT_FLOAT to mruby-numeric-ext (test only)
2017-10-16 18:14:34 +09:00
YAMAMOTO Masaya
9c1f21aaa1
Support MRB_WIHTOUT_FLOAT to mruby-string-ext
2017-10-16 18:09:56 +09:00
dearblue
44e2c97152
fix alias for Struct accessors
2017-10-15 23:43:55 +09:00
YAMAMOTO Masaya
5d781312ca
Support MRB_WIHTOUT_FLOAT to mruby-sprintf
2017-10-13 16:42:35 +09:00
Yukihiro "Matz" Matsumoto
fa974a1f6a
Merge pull request #3828 from asfluido/master
...
Correct a small error in parse.y
2017-10-12 20:19:24 +09:00
Carlo Prelz
af3d5d6c8a
Correct a small error in parse.y, which causes the reading of unassigned memory (triggers an error when address sanitizer is active)
2017-10-12 09:54:02 +02:00
Kazuho Oku
0d92431061
make the behavior consistent with MRI
2017-10-12 15:23:52 +09:00
YAMAMOTO Masaya
81ea81e05c
Fix typo
2017-10-11 19:52:21 +09:00
YAMAMOTO Masaya
3eebe81b35
Upadte AUTHORS
2017-10-11 19:44:34 +09:00
YAMAMOTO Masaya
dcd5d0ffec
Test for MRB_WITHOUT_FLOAT
2017-10-11 17:58:11 +09:00
YAMAMOTO Masaya
acdc2d1f24
Add MRB_WITHOUT_FLOAT
2017-10-11 17:58:11 +09:00
YAMAMOTO Masaya
679dfd75a8
Use division expression instead of some floating point literals
2017-10-11 17:58:11 +09:00
Tomasz Dąbrowski
be86d8b45f
correctly handle *splat arguments in mrb_get_argc, also add mrb_vm_get_argc and mrb_get_argv
...
Fixes #3825
2017-10-10 18:40:38 +02:00
Yukihiro "Matz" Matsumoto
80e03f3ffb
Merge pull request #3824 from nobu/bug/paren_arg
...
Bug/paren arg
2017-10-09 12:39:13 +09:00
Nobuyoshi Nakada
82983330a3
Fix parse error on TRICK2013/yhara
2017-10-09 08:56:46 +09:00
Nobuyoshi Nakada
1c2a2827b3
Replace lvar_defined with local_var_p
2017-10-09 08:54:25 +09:00
Tomoyuki Sahara
f8121953e7
Merge pull request #92 from palkan/master
...
Handle shared/frozen strings in IO#sysread
2017-10-05 21:27:58 +09:00
Vladimir Dementyev
43795cb1f1
Remove useless mrb_str_modify
2017-10-05 15:22:57 +03:00
Vladimir Dementyev
4c255c7739
Handle shared/frozen strings in IO#sysread
...
See https://github.com/mruby/mruby/commit/7edbe428caca6814841195a3f2720745cf04353e
2017-10-05 14:40:43 +03:00
Yukihiro "Matz" Matsumoto
c3c882f681
Use uint32_t to avoid signed integer overflow warning; #3816
2017-10-01 17:53:10 +09:00
Yukihiro "Matz" Matsumoto
8c408379aa
Add cscope.files to .gitignore.
2017-10-01 16:24:43 +09:00
Yukihiro "Matz" Matsumoto
7edbe428ca
Add new type of shared string: RSTR_FSHARED.
...
`RSTR_FSHARED` use frozen strings as shared body instead of
`struct mrb_shared_string`. This reduces allocation from
literal strings.
2017-10-01 16:24:43 +09:00
Yukihiro "Matz" Matsumoto
473b7d0efd
Cut links from irep in heaps finalization.
2017-09-29 00:18:55 +09:00
Yukihiro "Matz" Matsumoto
7b01b969f5
codedump to display OP_CALL.
2017-09-29 00:18:55 +09:00
Yukihiro "Matz" Matsumoto
29a9e698e3
Merge pull request #3815 from dabroz/fix-warnings
...
Fix MSVC 14.0 warnings
2017-09-29 00:18:39 +09:00
Tomasz Dąbrowski
999ce87129
fix: src\vm.c(2631): warning C4244: '=': conversion from 'mrb_int' to 'int', possible loss of data
2017-09-27 22:22:05 +02:00
Tomasz Dąbrowski
77d6a953ff
fix: src\vm.c(1757): warning C4244: '=': conversion from 'mrb_int' to 'int', possible loss of data
2017-09-27 22:22:05 +02:00
Tomasz Dąbrowski
ebd45b1072
fix: src\vm.c(1744): warning C4244: '=': conversion from 'mrb_int' to 'int', possible loss of data
2017-09-27 22:22:05 +02:00
Tomasz Dąbrowski
0bff4b6a09
fix: src\vm.c(1702): warning C4244: '=': conversion from 'mrb_int' to 'int', possible loss of data
2017-09-27 22:22:05 +02:00
Tomasz Dąbrowski
885916c84b
fix: src\vm.c(708): warning C4244: '=': conversion from 'mrb_int' to 'int', possible loss of data
2017-09-27 22:22:05 +02:00
Tomasz Dąbrowski
e88fc10679
fix: src\vm.c(704): warning C4244: '=': conversion from 'mrb_int' to 'int', possible loss of data
2017-09-27 22:22:05 +02:00
Tomasz Dąbrowski
ec7f478eda
fix: src\vm.c(457): warning C4244: '=': conversion from 'mrb_int' to 'int', possible loss of data
2017-09-27 22:22:05 +02:00
Tomasz Dąbrowski
67ab8406b8
fix: src\vm.c(445): warning C4244: '=': conversion from 'mrb_int' to 'int', possible loss of data
2017-09-27 22:22:05 +02:00
Tomasz Dąbrowski
23cc698134
fix: src\vm.c(438): warning C4244: '=': conversion from 'mrb_int' to 'int', possible loss of data
2017-09-27 22:22:05 +02:00
Tomasz Dąbrowski
5ede90cdf4
fix: src\vm.c(438): warning C4244: '=': conversion from 'mrb_int' to 'int', possible loss of data
2017-09-27 22:22:05 +02:00
Tomasz Dąbrowski
53f934a7ee
fix: src\string.c(2219): warning C4244: 'function': conversion from 'mrb_int' to 'int', possible loss of data
2017-09-27 22:22:05 +02:00
Tomasz Dąbrowski
ef8df492e9
fix: src\string.c(1924): warning C4244: '=': conversion from 'mrb_int' to 'int', possible loss of data
2017-09-27 22:22:05 +02:00
Tomasz Dąbrowski
027b8d8377
fix: src\string.c(1130): warning C4244: '=': conversion from 'mrb_int' to 'int', possible loss of data
2017-09-27 22:22:05 +02:00
Tomasz Dąbrowski
46ccabacf0
fix: src\string.c(497): warning C4244: '=': conversion from 'mrb_int' to 'long', possible loss of data
2017-09-27 22:22:05 +02:00
Tomasz Dąbrowski
6cde950017
fix: src\state.c(66): warning C4200: nonstandard extension used: zero-sized array in struct/union
2017-09-27 22:22:05 +02:00
Tomasz Dąbrowski
0e2976bf93
fix: src\range.c(136): warning C4244: '=': conversion from 'mrb_int' to 'int', possible loss of data
2017-09-27 22:22:05 +02:00
Tomasz Dąbrowski
b7e71e4cef
fix: src\proc.c(96): warning C4244: 'function': conversion from 'mrb_int' to 'int', possible loss of data
2017-09-27 22:22:05 +02:00
Tomasz Dąbrowski
490de9dbe1
fix: src\print.c(22): warning C4244: 'initializing': conversion from 'mrb_int' to 'int', possible loss of data
2017-09-27 22:22:05 +02:00
Tomasz Dąbrowski
220c628210
fix: src\pool.c(33): warning C4200: nonstandard extension used: zero-sized array in struct/union
2017-09-27 22:22:05 +02:00
Tomasz Dąbrowski
f0c1074b07
fix: src\numeric.c(1215): warning C4244: 'function': conversion from 'mrb_int' to 'int', possible loss of data
2017-09-27 22:22:05 +02:00
Tomasz Dąbrowski
4a0c9c9e31
fix: src\numeric.c(954): warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)
2017-09-27 22:22:05 +02:00
Tomasz Dąbrowski
332a04af73
fix: src\numeric.c(897): warning C4244: 'function': conversion from 'mrb_int' to 'mrb_float', possible loss of data
2017-09-27 22:22:05 +02:00
Tomasz Dąbrowski
971a4f9122
fix: src\kernel.c(874): warning C4244: 'function': conversion from 'mrb_int' to 'int', possible loss of data
2017-09-27 22:22:05 +02:00
Tomasz Dąbrowski
0e0c96096d
fix: src\kernel.c(861): warning C4244: '=': conversion from 'mrb_int' to 'int', possible loss of data
2017-09-27 22:22:05 +02:00
Tomasz Dąbrowski
7d98055862
fix: src\hash.c(139): warning C4244: 'function': conversion from 'mrb_int' to 'khint_t', possible loss of data
2017-09-27 22:22:05 +02:00
Tomasz Dąbrowski
8cef3f946c
fix: src\hash.c(40): warning C4244: '=': conversion from 'mrb_int' to 'khint_t', possible loss of data
2017-09-27 22:22:05 +02:00
Tomasz Dąbrowski
3e1d60ae0b
fix: src\hash.c(27): warning C4244: '=': conversion from 'mrb_int' to 'khint_t', possible loss of data
2017-09-27 22:22:05 +02:00
Tomasz Dąbrowski
c7b663f2cf
fix: src\gc.c(1425): warning C4244: '=': conversion from 'mrb_int' to 'int', possible loss of data
2017-09-27 22:22:04 +02:00
Tomasz Dąbrowski
b406e9f795
fix: src\gc.c(1392): warning C4244: '=': conversion from 'mrb_int' to 'int', possible loss of data
2017-09-27 22:22:04 +02:00
Tomasz Dąbrowski
1dcf8ba488
fix: src\gc.c(559): warning C4244: '=': conversion from 'mrb_int' to 'int', possible loss of data
2017-09-27 22:22:04 +02:00
Tomasz Dąbrowski
7a2391b120
fix: src\error.c(76): warning C4244: '=': conversion from 'mrb_int' to 'int', possible loss of data
2017-09-27 22:22:04 +02:00
Tomasz Dąbrowski
4d6b8dbcb9
fix: src\dump.c(710): warning C4244: 'function': conversion from 'mrb_int' to 'uint16_t', possible loss of data
2017-09-27 22:22:04 +02:00
Tomasz Dąbrowski
f4a17dd7b5
fix: src\dump.c(657): warning C4244: 'function': conversion from 'mrb_int' to 'uint16_t', possible loss of data
2017-09-27 22:22:04 +02:00
Tomasz Dąbrowski
5ed76e381c
fix: src\class.c(949): warning C4244: '=': conversion from 'mrb_int' to 'int', possible loss of data
2017-09-27 22:22:04 +02:00
Tomasz Dąbrowski
9c5db48d1f
fix: src\class.c(949): warning C4244: '=': conversion from 'mrb_int' to 'int', possible loss of data
2017-09-27 22:22:04 +02:00
Tomasz Dąbrowski
d8b37d0381
fix: src\class.c(583): warning C4244: '=': conversion from 'mrb_int' to 'int', possible loss of data
2017-09-27 22:22:04 +02:00
Tomasz Dąbrowski
4146b5c2b5
fix: src\backtrace.c(83): warning C4244: '=': conversion from 'mrb_int' to 'int', possible loss of data
2017-09-27 22:22:04 +02:00
Tomasz Dąbrowski
7507d46992
fix: src\array.c(86): warning C4244: '=': conversion from 'mrb_int' to 'uint32_t', possible loss of data
2017-09-27 22:22:04 +02:00
Tomasz Dąbrowski
be81504770
fix: mrbgems\mruby-time\src\time.c(641): warning C4244: '=': conversion from 'mrb_int' to 'int', possible loss of data
2017-09-27 22:22:04 +02:00
Tomasz Dąbrowski
0848407ee5
fix: mrbgems\mruby-time\src\time.c(372): warning C4244: 'function': conversion from 'mrb_int' to 'double', possible loss of data
2017-09-27 22:22:04 +02:00
Tomasz Dąbrowski
d713f8d761
fix: mrbgems\mruby-test\driver.c(67): warning C4244: '=': conversion from 'mrb_int' to 'int', possible loss of data
2017-09-27 22:22:04 +02:00
Tomasz Dąbrowski
2640896911
fix: mrbgems\mruby-string-ext\src\string.c(49): warning C4244: '=': conversion from 'mrb_int' to 'int', possible loss of data
2017-09-27 22:22:04 +02:00
Tomasz Dąbrowski
8d816fa142
fix: mrbgems\mruby-string-ext\src\string.c(30): warning C4244: '=': conversion from 'mrb_int' to 'long', possible loss of data
2017-09-27 22:22:04 +02:00
Tomasz Dąbrowski
d3819620ce
fix: mrbgems\mruby-string-ext\src\string.c(38): warning C4244: '=': conversion from 'mrb_int' to 'char', possible loss of data
2017-09-27 22:22:04 +02:00
Tomasz Dąbrowski
a94525d4ea
fix: mrbgems\mruby-sprintf\src\sprintf.c(1052): warning C4244: '+=': conversion from 'mrb_int' to 'int', possible loss of data
2017-09-27 22:22:04 +02:00
Tomasz Dąbrowski
1e2c962fa5
fix: mrbgems\mruby-sprintf\src\sprintf.c(623): warning C4244: 'function': conversion from 'mrb_int' to 'int', possible loss of data
2017-09-27 22:22:04 +02:00
Tomasz Dąbrowski
897eabb1bb
fix: mrbgems\mruby-sprintf\src\sprintf.c(646): warning C4244: 'function': conversion from 'mrb_int' to 'int', possible loss of data
2017-09-27 22:22:04 +02:00
Tomasz Dąbrowski
e10b329fa3
fix: mrbgems\mruby-sprintf\src\sprintf.c(618): warning C4244: 'initializing': conversion from 'mrb_int' to 'int', possible loss of data
2017-09-27 22:22:04 +02:00
Tomasz Dąbrowski
861077f779
fix: mrbgems\mruby-sprintf\src\sprintf.c(516): warning C4244: 'function': conversion from 'mrb_int' to 'int', possible loss of data
2017-09-27 22:22:04 +02:00
Tomasz Dąbrowski
553dbad2c6
fix: mrbgems\mruby-math\src\math.c(660): warning C4244: 'function': conversion from 'mrb_int' to 'int', possible loss of data
2017-09-27 22:22:04 +02:00
Tomasz Dąbrowski
49e96a2e19
fix: mrbgems\mruby-math\src\math.c(491): warning C4244: '=': conversion from 'mrb_int' to 'int', possible loss of data
2017-09-27 22:22:04 +02:00
Tomasz Dąbrowski
536b95eb48
fix: mrbgems\mruby-kernel-ext\src\kernel.c(114): warning C4244: 'function': conversion from 'mrb_int' to 'int', possible loss of data
2017-09-27 22:22:04 +02:00
Tomasz Dąbrowski
9d89f8c00b
fix: mrbgems\mruby-fiber\src\fiber.c(215): warning C4244: '=': conversion from 'mrb_int' to 'int', possible loss of data
2017-09-27 22:22:04 +02:00
Tomasz Dąbrowski
377d6a47ac
fix: mrbgems\mruby-exit\src\mruby-exit.c(10): warning C4244: 'function': conversion from 'mrb_int' to 'int', possible loss of data
2017-09-27 22:22:04 +02:00
Tomasz Dąbrowski
f632baddb1
fix: mrbgems\mruby-eval\src\eval.c(301): warning C4244: 'function': conversion from 'mrb_int' to 'int', possible loss of data
2017-09-27 14:42:27 +02:00
Tomasz Dąbrowski
49db1db81f
fix: mrbgems\mruby-eval\src\eval.c(214): warning C4244: '=': conversion from 'mrb_int' to 'short', possible loss of data
2017-09-27 14:42:27 +02:00
Tomasz Dąbrowski
2e239a296e
fix: mrbgems\mruby-compiler\core\parse.y(3455): warning C4244: 'function': conversion from 'intptr_t' to 'int', possible loss of data
2017-09-27 14:42:27 +02:00
Tomasz Dąbrowski
f1a02dff58
fix: include\mruby/gc.h(43): warning C4200: nonstandard extension used: zero-sized array in struct/union
2017-09-27 14:42:27 +02:00
Yukihiro "Matz" Matsumoto
381850280c
The [] special method call should be able to take a block.
2017-09-25 20:44:50 +09:00
Yukihiro "Matz" Matsumoto
e98823f189
The lex_state after literals should be EXPR_ENDARG.
2017-09-25 20:44:04 +09:00
Yukihiro "Matz" Matsumoto
e01d35ef79
The symbols should not take brace blocks.
2017-09-25 20:22:36 +09:00
Yukihiro "Matz" Matsumoto
298177fd6a
Merge pull request #3813 from dabroz/feature-fix-date
...
Change DISABLE_STDIO to MRB_DISABLE_STDIO in mruby-time/time.c
2017-09-25 20:19:13 +09:00
Tomasz Dabrowski
e00b48be4a
change DISABLE_STDIO to MRB_DISABLE_STDIO in mruby-time/time.c
2017-09-25 13:11:20 +02:00
Yukihiro "Matz" Matsumoto
7450a774a5
The first instruction was skipped mistakenly in ensure clause; fix #3811
2017-09-23 10:12:04 +09:00
Yukihiro "Matz" Matsumoto
0ceaa0960a
OP_EPOP operand may be bigger than mrb->c->eidx; fix #3810
2017-09-22 13:00:58 +09:00
Yukihiro "Matz" Matsumoto
5760226e71
Remove temporary limitation of OP_EPOP.
...
After f68f5f6 , the operand of `OP_EPOP` should have been `1`.
Now we have removed the limitation.
2017-09-12 12:41:02 +09:00
Tomoyuki Sahara
ab54185005
receiver variables must be "mrb_int" for mrb_get_args("i").
...
Otherwise, it can cause a segfault on the platforms where the
size of "int" and "mrb_int" differs.
2017-09-12 12:32:12 +09:00
Tomoyuki Sahara
a809d42f5a
remove whitespaces at the end of line.
2017-09-12 11:43:21 +09:00
Yukihiro "Matz" Matsumoto
d6e41c3e51
The callinfo stack may be reallocated in cipush; fix rest of #3809
...
fix #3809
2017-09-11 23:13:47 +09:00
Yukihiro "Matz" Matsumoto
3d8c1a7e97
The ensure stack may be empty at OP_EPOP; fix 1st part of #3809
2017-09-11 22:46:34 +09:00
Yukihiro "Matz" Matsumoto
2a1e616e4d
Avoid calling mrb_funcall to invoke #initialize from Class.new.
...
If `#initialize` is implemented in C, we don't need stack consuming
`mrb_funcall`.
2017-09-06 14:35:24 +09:00
Yukihiro "Matz" Matsumoto
cbfa2b3588
Avoid recursion from mark_context().
2017-09-05 21:13:16 +09:00
Yukihiro "Matz" Matsumoto
f68f5f6b97
Avoid crossing C function boundary from OP_EPOP; ref #3789
2017-09-05 21:12:36 +09:00
Yukihiro "Matz" Matsumoto
7f4b57bb20
Restrict OP_EPOP operand to 1; ref #3789
2017-09-05 21:11:41 +09:00
Tomoyuki Sahara
15f4bdb529
Merge pull request #37 from udzura/fix-types
...
Fix type int to mrb_int
2017-09-04 23:55:37 +09:00
Uchio KONDO
5b6e4eda2a
Fix type int to mrb_int
...
- mruby's default int size is changed after: https://github.com/mruby/mruby/commit/f0f4a1088a270e339407a24ffe8be748f4764fc2
- implicit cast causes some errors
2017-09-04 16:33:57 +09:00
Yukihiro "Matz" Matsumoto
3acaa44a70
Restructure irep->outer chain; fix #3804
...
Instead of `irep -> proc` chain, we use `irep -> irep` chain to
avoid GC bugs like #3804 . We added `target_class` reference to
`mrb_irep` struct. That means one more word consumption per `irep`.
2017-09-04 06:51:31 +09:00
Yukihiro "Matz" Matsumoto
8a5d783f2e
Call initialize only when it's not empty.
2017-09-04 06:49:05 +09:00
Yukihiro "Matz" Matsumoto
5d7e4957e0
Merge pull request #3806 from flaviommedeiros/master
...
Trying to make the code more readable
2017-09-03 07:51:12 +09:00
Yukihiro "Matz" Matsumoto
da97715e11
Merge pull request #3805 from fl0l0u/patch-1
...
Update print.c
2017-09-03 07:48:33 +09:00
fl0l0u
e03042ec19
Update print.c
...
Strings not containing a newline are not printed synchronously
ex. bin/mruby -e '["a", "b", "c", "\n", "d", "e", "f", "\n"].each {|e| print e ; usleep 200000}'
2017-09-02 18:26:50 +02:00
Flavio Medeiros
9f677b72db
Trying to make the source code more understandable by removing mixing of ternary if statements with attributions.
2017-09-02 13:25:09 -03:00
Yukihiro "Matz" Matsumoto
476af3c647
Merge pull request #3802 from christopheraue/proc_break_tests
...
Tested local jump errors caused by break in a proc
2017-09-02 22:19:15 +09:00
Yukihiro "Matz" Matsumoto
ab99e2c293
Avoid copying over initialized procs using initialize_copy; fix #3803
...
It may be better to raise exceptions, but CRuby doesn't.
2017-09-01 06:51:59 +09:00
Yukihiro "Matz" Matsumoto
57610091ce
Update method cache clearing.
2017-09-01 06:51:59 +09:00
Yukihiro "Matz" Matsumoto
f0f4a1088a
Make the default integer size to be MRB_INT64 on 64bit systems; close #3800
...
Unless `MRB_NAN_BOXING` is specified.
2017-09-01 06:51:59 +09:00
Christopher Aue
35deaae776
Tested LocalJumpErrors caused by break in a proc
2017-08-30 12:25:55 +02:00
Yukihiro "Matz" Matsumoto
71357ff1d8
Merge pull request #3801 from christopheraue/assert_raise_refactoring
...
Allowed to pass multiple exceptions to assert_raise
2017-08-30 18:56:59 +09:00
Christopher Aue
bf32265743
Allowed to pass multiple exceptions to assert_raise
2017-08-30 11:03:51 +02:00
Yukihiro "Matz" Matsumoto
fe3227cd5c
Set the ORPHAN flag in Proc.new; fix #3798
2017-08-30 16:51:40 +09:00
Yukihiro "Matz" Matsumoto
483a038d39
Fixed a critical typo; ref #3798
2017-08-30 16:51:17 +09:00
Yukihiro "Matz" Matsumoto
2c85213298
Need to mark mrb->range_class; fix #3797
2017-08-30 16:12:12 +09:00
Yukihiro "Matz" Matsumoto
79b4f61b02
Merge pull request #3799 from christopheraue/assert_raise_refactoring
...
Refactored #assert_raise and #assert_nothing_raised
2017-08-30 14:47:12 +09:00
Christopher Aue
4b0b8f7e1a
Refactored #assert_raise and #assert_nothing_raised
2017-08-29 23:25:53 +02:00
Yukihiro "Matz" Matsumoto
8976f47e0a
Need to update ci after callinfo stack reallocation; fix #3796
2017-08-29 11:06:34 +09:00
Yukihiro "Matz" Matsumoto
c082249838
Exclude the top-level closure from each_object; fix #3793
2017-08-29 09:29:14 +09:00
Yukihiro "Matz" Matsumoto
786cbf06c3
Revert "Clear irep->outer when no Proc reference the irep; fix #3793 "
...
This reverts commit 15d48efa4b .
2017-08-29 09:27:45 +09:00
Yukihiro "Matz" Matsumoto
1260d3b68a
Add `__ENCODING__' support.
...
`__ENCODING__' returns the current encoding name (string), unlike
CRuby that returns the encoding object.
2017-08-28 22:42:06 +09:00
Yukihiro "Matz" Matsumoto
f1fa5bf1c6
Remove integer type mismatch warnings from parse.y.
2017-08-28 22:31:02 +09:00
Yukihiro "Matz" Matsumoto
15d48efa4b
Clear irep->outer when no Proc reference the irep; fix #3793
2017-08-28 10:06:04 +09:00
Yukihiro "Matz" Matsumoto
fd927d786e
Merge pull request #3795 from christopheraue/array_refactoring
...
Array refactorings and speed improvements
2017-08-27 08:56:41 +09:00
Christopher Aue
c956e17c02
Replaced Array#each with while loop for performance reasons
...
Example benchmark:
$ time build/bench/bin/mruby -e "Array.new(2_000_000){ |i| i }.index{ |i| i == 1_999_999 }"
Before:
real 0m0.934s
user 0m0.922s
sys 0m0.003s
After:
real 0m0.590s
user 0m0.583s
sys 0m0.007s
2017-08-26 15:57:25 +02:00
Christopher Aue
6c9013e22b
Removed unneeded block check in Array#uniq
2017-08-26 15:57:25 +02:00
Christopher Aue
f3fb43c729
Reimplemented Array#flatten with #flatten!
2017-08-26 15:57:25 +02:00
Yukihiro "Matz" Matsumoto
ccd555421a
Merge pull request #3794 from dabroz/fix-flt-epsilon
...
Fix building with MRB_USE_FLOAT=1
2017-08-26 22:29:00 +09:00
Tomasz Dąbrowski
01b9b71902
fix mrbgems/mruby-range-ext/src/range.c:142:71: error: use of undeclared identifier 'FLT_EPSILON'
2017-08-26 12:11:57 +02:00
Yukihiro "Matz" Matsumoto
85a400e43d
Reimplement Array#shift to be faster.
2017-08-26 02:03:21 +09:00
Yukihiro "Matz" Matsumoto
cec53ff77e
Array#first to treat 1 argument case specially to improve performance.
2017-08-26 02:03:21 +09:00
Yukihiro "Matz" Matsumoto
1b545a6b63
Check for ability to skip optional argument parsing.
2017-08-26 02:03:21 +09:00
Yukihiro "Matz" Matsumoto
60104ce41d
Silence compiler warning regarding float condition; fix #3790
2017-08-26 02:02:45 +09:00
Yukihiro "Matz" Matsumoto
43ec918be1
Remove unused mrb_obj_iv_ifnone() from API.
2017-08-26 02:01:50 +09:00
Yukihiro "Matz" Matsumoto
0e10a23d7a
Add checks if iv_tbl is NULL.
2017-08-26 02:01:50 +09:00
Yukihiro "Matz" Matsumoto
0c52112dd4
Keep Range class in mrb_state structure for performance.
2017-08-26 02:01:50 +09:00
Yukihiro "Matz" Matsumoto
04dbbff3c1
Use khash for instance variables tables instead of segment list.
...
For performance reason. Segmented list consumes slightly less memory
but takes a lot of time especially when there are many slots in the
segment lists (e.g. class constants).
2017-08-26 02:01:50 +09:00
Yukihiro "Matz" Matsumoto
f2cc1239a5
Turn on method cache for Travis CI.
2017-08-26 02:01:50 +09:00
Yukihiro "Matz" Matsumoto
f7f1aca8b5
Merge pull request #3792 from dabroz/fix-test-int16
...
Fix string test with 16-bit integers
2017-08-26 02:00:30 +09:00
Yukihiro "Matz" Matsumoto
5f2c7e47bb
Merge pull request #3791 from dabroz/fix-msvc-warning
...
Fix MSVC warnings in fmt_fp.c
2017-08-26 01:54:59 +09:00
Tomasz Dąbrowski
17c249780f
fix String#% %d test with MRB_INT16 set
2017-08-25 14:36:05 +02:00
Tomasz Dąbrowski
5d9b84ef40
fix fmt_fp.c(329) : warning C4244: 'return' : conversion from 'ptrdiff_t' to 'int', possible loss of data
2017-08-25 14:18:31 +02:00
Tomasz Dąbrowski
78b13b3955
fix fmt_fp.c(251) : warning C4244: '=' : conversion from '__int64' to 'int', possible loss of data
2017-08-25 14:18:05 +02:00
Tomasz Dąbrowski
ef6a762d41
fix fmt_fp.c(224) : warning C4244: '=' : conversion from 'ptrdiff_t' to 'int', possible loss of data
2017-08-25 14:14:17 +02:00
Tomasz Dąbrowski
bac37a9f1a
fix fmt_fp.c(220) : warning C4244: '=' : conversion from '__int64' to 'int', possible loss of data
2017-08-25 14:13:06 +02:00
Tomasz Dąbrowski
b2a16d6bf7
fix fmt_fp.c(206) : warning C4244: 'initializing' : conversion from 'ptrdiff_t' to 'int', possible loss of data
2017-08-25 14:12:08 +02:00
Tomasz Dąbrowski
c8341dbf7c
fix fmt_fp.c(178) : warning C4244: 'return' : conversion from 'ptrdiff_t' to 'int', possible loss of data
2017-08-25 14:10:43 +02:00
Tomasz Dąbrowski
5d099e40e6
fix fmt_fp.c(123) : warning C4244: 'return' : conversion from 'ptrdiff_t' to 'int', possible loss of data
2017-08-25 14:10:24 +02:00
Yukihiro "Matz" Matsumoto
63f10a1ee5
Merge pull request #3788 from christopheraue/fix_codegen_op_send_nregs
...
Fixed register windows of OP_SENDs generated during codegen
2017-08-24 14:38:03 +09:00
Christopher Aue
3366894a40
Fixed register windows of OP_SENDs generated by NODE_{DREGX,REGX}; ref #3783
2017-08-23 18:16:05 +02:00
Christopher Aue
499498a6a7
Tested register windows of OP_SENDs generated by NODE_{DXSTR,XSTR}; ref #3783
2017-08-23 18:15:54 +02:00
Christopher Aue
84d8ecc1d7
Fixed register windows of OP_SENDs generated by NODE_OP_ASGN; ref #3783
2017-08-23 18:15:44 +02:00
Christopher Aue
4aca9ef98e
Refactored code around generation of OP_SEND in NODE_OP_ASGN
2017-08-23 18:15:38 +02:00
Christopher Aue
1221f7676e
Fixed register windows of OP_SENDs generated by NODE_{FOR,SYMBOLS}; ref #3783
2017-08-23 18:15:27 +02:00
Christopher Aue
c040c8d92b
Tested register windows of OP_SENDs generated by NODE_{RESCUE,HASH,ALIAS}; ref #3783
2017-08-23 18:15:08 +02:00
Christopher Aue
c6596cf26a
Fixed register windows of OP_SENDs generated by NODE_{SCALL,CASE,YIELD,UNDEF}; ref #3783
2017-08-23 18:12:35 +02:00
Christopher Aue
64e5208404
Asserted bidx < ci->nregs for OP_SEND and OP_SUPER
2017-08-23 15:18:06 +02:00
Yukihiro "Matz" Matsumoto
4c9a604877
Added method cache.
...
To enable method cache, define `MRB_METHOD_CACHE` or
`MRB_METHOD_CACHE_SIZE`. The cache size must be power of 2.
The default cache size is 128.
The measurement:
I measured simple benchmarks found in benchmark/ directory. With
method cache enabled, we gained 6-8% performance improvement, with
97-99% cache hit rate.
2017-08-22 22:17:01 +09:00
Yukihiro "Matz" Matsumoto
a65f4dbb32
Remove possible path that leaves a local variable uninitialized.
2017-08-22 15:50:08 +09:00
Yukihiro "Matz" Matsumoto
db437b04a4
mrb_obj_respond_to to use mrb_method_search_vm.
2017-08-22 14:23:46 +09:00
Yukihiro "Matz" Matsumoto
0d865a77d5
c (mrbc_context) may be NULL; fix #3787
2017-08-22 09:47:10 +09:00
Yukihiro "Matz" Matsumoto
ab3b6dbd2a
strlen returns size_t; need to cast before assigning to int.
2017-08-22 08:14:09 +09:00
Yukihiro "Matz" Matsumoto
3f90af6b42
(Try to) fix mixture of int and size_t in UTF-8 conversion.
...
This only effects VC.
2017-08-22 07:35:51 +09:00
Yukihiro "Matz" Matsumoto
a7d611fb23
Reduce signed/unsigned warnings in dump.c
2017-08-19 21:50:36 +09:00
Yukihiro "Matz" Matsumoto
5d0fc7e57a
Reduce signed/unsigned warnings in fmt_fp.c
2017-08-19 17:09:30 +09:00
Yukihiro "Matz" Matsumoto
8cea1f8907
Use ptrdiff_t instead of int.
2017-08-19 15:51:08 +09:00
Yukihiro "Matz" Matsumoto
a117ec771b
Remove mixed signed/unsigned comparison in debug.c.
2017-08-19 14:42:30 +09:00
Yukihiro "Matz" Matsumoto
834523945e
Replace stack pop() by push_n(2); pop_n(3); fix #3783
...
To calculate correct register windows size. The fix was suggested
by Christopher Aue.
2017-08-19 11:56:04 +09:00
Yukihiro "Matz" Matsumoto
db098d3e0e
Type check before traversing irep->outer; fix #3782
2017-08-19 11:39:42 +09:00
Yukihiro "Matz" Matsumoto
2294ebdd44
Call mrb_full_gc before gc_each_objects; ref #3782
...
Otherwise dead object may be seen from `#each_object`.
2017-08-19 11:38:11 +09:00
Yukihiro "Matz" Matsumoto
9146d5c34f
Zero width unshift should not touch memory; ref #3780
2017-08-19 11:11:26 +09:00
Yukihiro "Matz" Matsumoto
8b3298b2d6
Unshift pointer move size was wrong (not len but alen); fix #3780
2017-08-19 11:08:46 +09:00
Yukihiro "Matz" Matsumoto
29ad0a7964
capacify' for mrb_str_new_capa should not be 0`.
2017-08-18 23:42:34 +09:00
Yukihiro "Matz" Matsumoto
a8bd06904d
mrb_str_cat: capa should not be zero to avoid infinite loops.
2017-08-18 23:42:34 +09:00
Yukihiro "Matz" Matsumoto
a06adb176f
mrb_str_cat: capa should be bigger than total.
2017-08-18 23:42:33 +09:00
Yukihiro "Matz" Matsumoto
8b5be554c7
ARY_CAPA handles capacity for embedded arrays by itself.
2017-08-18 23:42:33 +09:00
Yukihiro "Matz" Matsumoto
8fbc4bef55
Reduce signed/unsigned comparison warnings; ref #3785
2017-08-18 22:54:59 +09:00
Yukihiro "Matz" Matsumoto
f1767fd079
Separate mrb_str_buf_new and mrb_str_new_capa.
...
`mrb_str_buf_new` is an old function that ensures capacity size of
`MRB_STR_BUF_MIN_SIZE` minimum. Usually one need to use
`mrb_str_new_capa` instead.
2017-08-18 22:17:48 +09:00
Yukihiro "Matz" Matsumoto
722d123b87
Remove code duplication in mrb_str_concat.
2017-08-18 22:17:48 +09:00
Yukihiro "Matz" Matsumoto
198c898817
Rename mrb_str_concat2 to mrb_str_concat_m.
...
According to the naming convention a function that implements
a method should be suffixed by `_m`.
2017-08-18 22:17:47 +09:00
Yukihiro "Matz" Matsumoto
4c25738ac7
Merge str_buf_cat and mrb_str_cat.
2017-08-18 22:17:47 +09:00
Yukihiro "Matz" Matsumoto
2adb0c201e
Merge pull request #3786 from christopheraue/3784_fix
...
Reset ci in OP_SUPER after potential realloc
2017-08-18 22:17:33 +09:00
Yukihiro "Matz" Matsumoto
11c3ad999e
Merge pull request #3781 from clayton-shopify/fix-hash-compact-bang
...
Check whether internal khash is initialized in Hash#compact!
2017-08-18 22:13:33 +09:00
Yukihiro "Matz" Matsumoto
f229ed917e
Merge pull request #3785 from miura1729/original
...
Improve Array structure
2017-08-18 20:37:31 +09:00
Miura Hideki
75ec86ed00
Improve Array structure
2017-08-18 20:12:00 +09:00
Christopher Aue
6b0860ce61
Reset ci in OP_SUPER after potential realloc
2017-08-18 13:11:08 +02:00
Clayton Smith
5dc688fb12
Check whether internal khash is initialized in Hash#compact!
2017-08-17 12:13:41 -04:00
Yukihiro "Matz" Matsumoto
0789ec71e0
Merge pull request #3779 from christopheraue/vm_refactoring
...
Some more vm refactorings
2017-08-13 07:11:21 +09:00
Christopher Aue
d5ac785b31
Reintroduced not storing converted proc directly in the stack
2017-08-12 23:59:40 +02:00
Christopher Aue
198df61039
Removed unneeded ci->nregs checks in OP_SEND and OP_SUPER
...
Because of #3504 `ci->nregs = bidx+1` was introduced in b64f08784c .
This led to the follow up error #3551 whose fix introduced the `if (bidx >= ci->nregs)`
check in 071164b799 and the `stack_extend(mrb, ci->nregs)`
in 93d802987e .
Then, the code causing #3504 reappeared again in #3590 . The fix for it moved the code
dealing with the block in OP_SUPER from below the `cipush` to above the `cipush`
in d9fb8b69b0 . The `if (bidx >= ci->nregs) { ... }` from
then on works with the original callinfo and not the pushed one. `ci->nregs` needed to
be modified for the pushed one because it is initialized to 0. But for the original ci
it is propertly set and a check is not needed.
2017-08-12 23:27:17 +02:00
Christopher Aue
f2d4640998
Extended stack always based on ci->nregs
2017-08-12 14:47:22 +02:00
Christopher Aue
3f591d71c6
Refactored variable usage in OP_SEND and OP_SUPER
2017-08-12 14:31:18 +02:00
Yukihiro "Matz" Matsumoto
8bf492f127
Reduce integer type mismatch warnings in VC.
2017-08-12 09:35:35 +09:00
Yukihiro "Matz" Matsumoto
baa5d2e3f7
Remove some empty lines; ref #3778
2017-08-11 22:39:31 +09:00
Yukihiro "Matz" Matsumoto
0828a962c0
Merge pull request #3778 from christopheraue/vm_refactoring
...
Refactored OP_SEND and OP_SUPER and calculate argc right at the top
2017-08-11 22:38:32 +09:00
Yukihiro "Matz" Matsumoto
42f9af41fb
Merge pull request #3777 from christopheraue/super_method_missing_test
...
Added basic test for calling a missing method through super
2017-08-11 22:35:40 +09:00
Christopher Aue
731dd78aa0
Added basic test for calling a missing method through super
2017-08-11 14:09:22 +02:00
Christopher Aue
58f5115b22
Refactored OP_SEND and OP_SUPER and calculate argc right at the top
2017-08-11 13:42:06 +02:00
Yukihiro "Matz" Matsumoto
d077a5f0a6
scan_hex may be used to parse both unicode and hex escape.
...
The error checks for both usage should be separated; ref #3774
2017-08-11 14:25:02 +09:00
Yukihiro "Matz" Matsumoto
56d4e41d76
Fixed a wrong condition in scan_hex; fix #3774
2017-08-11 14:14:30 +09:00
Yukihiro "Matz" Matsumoto
96d4c2d385
Remove an unused argument from each_backtrace_func.
2017-08-11 13:52:24 +09:00
Yukihiro "Matz" Matsumoto
1d781da8a6
Should not include float.h here.
2017-08-11 13:52:01 +09:00
Yukihiro "Matz" Matsumoto
db72cdae28
Merge branch 'christopheraue-super_method_missing_fix'
2017-08-11 13:16:40 +09:00
Yukihiro "Matz" Matsumoto
ab39ed4f82
Defer mid update after unshift; ref #3776
2017-08-11 13:15:50 +09:00
Yukihiro "Matz" Matsumoto
9feb069124
Merge branch 'super_method_missing_fix' of https://github.com/christopheraue/mruby into christopheraue-super_method_missing_fix
2017-08-11 13:14:32 +09:00
Yukihiro "Matz" Matsumoto
0ff28c9e60
Silence integer type conversion warnings.
2017-08-11 13:10:31 +09:00
Yukihiro "Matz" Matsumoto
ef0b239704
Remove unnecessary inline function ary_elt.
...
And the function does not conform the naming convention anyway.
2017-08-11 12:57:37 +09:00
Yukihiro "Matz" Matsumoto
67e2dddb82
Remove mrb_ary_len function. Use RARRAY_LEN instead.
2017-08-11 12:52:36 +09:00
Yukihiro "Matz" Matsumoto
8f6b2121d9
Update document comment of array C API functions.
2017-08-11 12:51:45 +09:00
Yukihiro "Matz" Matsumoto
4e2f4f4280
Avoid possible data loss by using ptrdiff_t.
2017-08-11 12:12:11 +09:00
Yukihiro "Matz" Matsumoto
ae04005092
The type of ARY_EMBED_LEN should be mrb_int.
2017-08-11 12:09:37 +09:00
Yukihiro "Matz" Matsumoto
3e075a7b6c
Should not call to_str in mrb_vformat; fix #3773
2017-08-11 09:21:47 +09:00
Yukihiro "Matz" Matsumoto
68470bef86
Check method existence in `to_enum'; ref #3773
2017-08-11 09:21:09 +09:00
Christopher Aue
2249551c63
Fixed calling missing method through super with 126 args
2017-08-10 23:26:39 +02:00
Yukihiro "Matz" Matsumoto
ac42ccc1fc
Merge pull request #3772 from vvakame/add2authors
...
Updated AUTHORS
2017-08-10 09:50:08 +09:00
vvakame
a8658b0f2c
Updated AUTHORS
2017-08-10 09:21:40 +09:00
Yukihiro "Matz" Matsumoto
a7462a7f42
Remove redundant flo_hash function.
...
`flo_hash` implemented `15.2.8.3.18` but `Kernel#hash` (15.3.1.3.15)
now works for numbers.
2017-08-10 08:47:01 +09:00
Yukihiro "Matz" Matsumoto
3d288ef0d8
Use standard hash functions in mrb_hash_ht_hash_func.
2017-08-10 08:47:01 +09:00
Yukihiro "Matz" Matsumoto
78be0172f7
Normalize float numbers before calculating a hash value.
2017-08-10 08:36:09 +09:00
Yukihiro "Matz" Matsumoto
9826ca54f2
VM stack may be reallocated during mrb_hash_get; fix #3771
2017-08-10 08:21:43 +09:00
Yukihiro "Matz" Matsumoto
9e0c48ddc6
Merge pull request #3770 from christopheraue/tabs_to_spaces
...
Replaced tabs with spaces
2017-08-10 07:59:49 +09:00
Christopher Aue
2fadddcd20
Replaced tabs with spaces
2017-08-09 21:56:27 +02:00
Yukihiro "Matz" Matsumoto
24c345fe5c
Merge branch 'vvakame-add-hash-compact'
2017-08-09 21:21:31 +09:00
Yukihiro "Matz" Matsumoto
6c61a60609
Implement Hash#compact! in C; ref #3769
2017-08-09 21:20:50 +09:00
vvakame
4d46f366ac
add method(compact, compact!) and test of Hash to mruby-hash-ext
2017-08-09 19:18:02 +09:00
Yukihiro "Matz" Matsumoto
f9c3ebd29d
Wrong blkargs pos for vararg; ref #3768
2017-08-09 15:23:20 +09:00
Yukihiro "Matz" Matsumoto
0a61df1c34
The block argument offset saved in the env was wrong; fix #3768
...
When the method takes variable number of argument (`argc = -1`),
the block argument offset should be `-1` not `0`.
2017-08-09 12:57:55 +09:00
Yukihiro "Matz" Matsumoto
8f62957888
Support break within rescue clauses; fix #3767 ref #3721
2017-08-09 12:25:20 +09:00
Yukihiro "Matz" Matsumoto
66e2928bd4
Float values divided by zero should honor signs; fix #3766
...
It also fixes unexpected resurrection of #3745 by #3752
2017-08-08 02:13:11 +09:00
Yukihiro "Matz" Matsumoto
8494557006
Set the current pc as the error position in OP_ERR; ref #3765
2017-08-08 01:55:46 +09:00
Yukihiro "Matz" Matsumoto
e910cf6169
Check if ptr is NULL before calling memset; fix #3765
2017-08-08 01:54:43 +09:00
Yukihiro "Matz" Matsumoto
1358725738
Merge pull request #3764 from christopheraue/new_hash_perf
...
Improved speed of creating new hash tables
2017-08-07 01:48:39 +09:00
Christopher Aue
ec7475d88b
Prevented resizing just created hashes in specific size ranges
2017-08-05 20:59:26 +02:00
Christopher Aue
0e5c3c4ebd
Improved speed of creating new hash tables
2017-08-04 22:08:29 +02:00
Yukihiro "Matz" Matsumoto
1b9c4855a3
proc->body.irep may be NULL; fix #3761
2017-08-05 01:28:11 +09:00
Yukihiro "Matz" Matsumoto
006661394d
Fixed heap buffer overflow in mrb_ary_unshift_m; fix #3760
2017-08-05 01:18:52 +09:00
Yukihiro "Matz" Matsumoto
36dbfd9bda
Change return type of scan_oct from int to int32_t.
2017-08-05 01:06:36 +09:00
Yukihiro "Matz" Matsumoto
e86c252a99
Left shift of signed integers is undefined behavior in C; fix #3762
2017-08-05 01:06:36 +09:00
Yukihiro "Matz" Matsumoto
8095754e28
Merge pull request #3763 from mimaki/fix-mrdb-source-path
...
Fixed a invalid source path name on mruby debugger.
2017-08-04 23:41:14 +09:00
Hiroshi Mimaki
7bdc709da0
Fixed a invalid source path name on mruby debugger.
2017-08-04 17:25:03 +09:00
Yukihiro "Matz" Matsumoto
7b88c1a8e5
Now local_variables works when for closures; fix #3710
2017-08-02 07:44:58 +09:00
Yukihiro "Matz" Matsumoto
da24af34b9
Better class name management.
...
The change removes several internal instance variables used by
class name management. The variables `__classid__` and `__classpath__`
are no longer available. `__outer__` is used only for unnamed outer
classes/modules (and will be removed after they are named).
[Important note]
Along with this change we removed several public functions.
- mrb_class_outer_module()
- mrb_class_sym()
We believe no one have used those functions, but if you do, please
ask us for the workaround.
2017-08-01 22:25:49 +09:00
Yukihiro "Matz" Matsumoto
2170fad406
Cosmetic changes (removing spaces before * in return types).
2017-08-01 16:31:18 +09:00
Yukihiro "Matz" Matsumoto
648e9ea51b
Move naming unnamed classes/modules
...
From `mrb_mod_const_set` to `mrb_const_set`.
2017-08-01 16:25:09 +09:00
Yukihiro "Matz" Matsumoto
3f6a098626
Reimplement constant look-up rule to follow lexical scoping.
...
This update fix CRuby scoping incompatibility; close #600 ; close #3200
2017-08-01 15:57:32 +09:00
Yukihiro "Matz" Matsumoto
9e10afe1d0
Implements `Module::nesting' (15.2.2.3.2); ref #600 , #3200
2017-08-01 15:37:21 +09:00
Yukihiro "Matz" Matsumoto
16aafdd866
Merge pull request #3759 from christopheraue/authors_update
...
Updated AUTHORS
2017-07-31 07:27:04 +09:00
Yukihiro "Matz" Matsumoto
facf5f99d4
Merge pull request #3758 from christopheraue/enumeration_perf
...
Improved speed of enumeration methods
2017-07-31 07:26:46 +09:00
Christopher Aue
a4ff31eaf6
Updated AUTHORS
2017-07-30 16:19:24 +02:00
Christopher Aue
3359b86ec7
Improved speed of enumeration methods
2017-07-30 13:19:31 +02:00
Yukihiro "Matz" Matsumoto
c8fdab8725
Merge branch 'udzura-move-task-class-definitions'
2017-07-29 07:15:10 +09:00
Yukihiro "Matz" Matsumoto
e821c25d38
Merge branch 'move-task-class-definitions' of https://github.com/udzura/mruby into udzura-move-task-class-definitions
2017-07-29 07:09:53 +09:00
Yukihiro "Matz" Matsumoto
b290e98f3b
Merge pull request #3757 from christopheraue/module_const_get_class_path
...
Extended Module#const_get to support class paths
2017-07-29 07:05:37 +09:00
Yukihiro "Matz" Matsumoto
cf23a85333
Merge pull request #3755 from christopheraue/array_bsearch_index
...
Added Array#bsearch_index
2017-07-29 07:01:53 +09:00
Yukihiro "Matz" Matsumoto
dda73da640
Merge pull request #3756 from christopheraue/fix_mod_include_ret_val
...
Fixed return value of Module#include and #prepend
2017-07-29 06:53:06 +09:00
Christopher Aue
a3bfd735a0
Added Array#bsearch_index
2017-07-28 23:51:49 +02:00
Christopher Aue
451574f142
Refactored Array#bsearch
2017-07-28 23:51:40 +02:00
Christopher Aue
f937af5745
Extended Module#const_get to support class paths
2017-07-28 23:19:49 +02:00
Christopher Aue
c7018ea962
Added mrb_str_index to the mrb API
2017-07-28 21:07:20 +02:00
Christopher Aue
b499ad6749
Fixed return value of Module#include and #prepend
2017-07-28 17:38:40 +02:00
Christopher Aue
8a6ce74b4d
Tested Array#bsearch more thoroughly
2017-07-28 17:15:35 +02:00
Yukihiro "Matz" Matsumoto
4696093673
Rename MRB_SEGMENT_SIZE to MRB_IV_SEGMENT_SIZE.
2017-07-27 16:14:03 +09:00
Yukihiro "Matz" Matsumoto
1e41026b28
Always use MRB_USE_IV_SEGLIST.
2017-07-27 16:14:03 +09:00
Yukihiro "Matz" Matsumoto
f26d00d9e8
Embed small size array elements in the heap.
...
It reduces the memory consumption and sometimes improve the
performance as well. For example, the consumed memory size
of `bench/bm_ao_render.rb` is reduced from 1.2GB to 1GB, and
its total execution time become 18.795 sec from 22.229 sec.
2017-07-27 16:13:06 +09:00
Yukihiro "Matz" Matsumoto
5d44f8582e
Remove loop from OP_POPERR.
2017-07-27 10:30:43 +09:00
Yukihiro "Matz" Matsumoto
7d5cf8749a
(0).div(0.0) should be NaN; fix #3754
2017-07-26 15:48:50 +09:00
Yukihiro "Matz" Matsumoto
46ab8fdf07
(0.0).div(0) should not be infinity; fix #3753
2017-07-25 15:28:41 +09:00
Yukihiro "Matz" Matsumoto
9fa3d77114
0/0 should not be infinity; fix #3752
2017-07-25 15:11:31 +09:00
Yukihiro "Matz" Matsumoto
7b8d784040
Reimplement sort method to reduce array copying.
2017-07-25 14:42:38 +09:00
Yukihiro "Matz" Matsumoto
7f9e333647
Should not update @objs from mruby-bin-mruby mrbgem.rake; fix #3751
2017-07-24 16:53:20 +09:00
Yukihiro "Matz" Matsumoto
308341b990
Clear mrb_callinfo struct by zero initializer.
2017-07-24 16:47:11 +09:00
Yukihiro "Matz" Matsumoto
1fc9a3019d
Initialize potentially uninitialized local variable.
2017-07-24 16:46:27 +09:00
Yukihiro "Matz" Matsumoto
1c360965e7
Need to unshare env on OP_R_BREAK too.
2017-07-21 10:57:21 +09:00
Yukihiro "Matz" Matsumoto
5fee3f5869
Move NULL check to mrb_env_unshare(); ref #3750
2017-07-21 10:14:15 +09:00
Yukihiro "Matz" Matsumoto
e2c9a30571
Should not raise LocalJumpError on funcall'ed frame; fix #3750
2017-07-21 07:17:21 +09:00
Yukihiro "Matz" Matsumoto
04c21d9d6b
Merge pull request #3749 from christopheraue/fix_spec_rbfiles
...
Fixed setting custom rbfiles in gemspec
2017-07-20 23:14:34 +09:00
Yukihiro "Matz" Matsumoto
25a0a6b038
Need to patch OP_GETUPVAR and OP_SETUPVAR; fix #3732
2017-07-20 22:47:20 +09:00
Christopher Aue
5a9eedf541
Fixed setting custom rbfiles in gemspec
2017-07-19 19:46:36 +02:00
Yukihiro "Matz" Matsumoto
aa3cb0466e
Avoid C undefined behavior of division by zero; close #3745
2017-07-19 09:49:41 +09:00
Yukihiro "Matz" Matsumoto
ca2cfc6fe9
Merge pull request #3746 from christopheraue/mod_singleton_class_p
...
Implemented Module#singleton_class?
2017-07-19 09:08:11 +09:00
Yukihiro "Matz" Matsumoto
645b0fb58c
Merge branch 'christopheraue-const_set_mod_to_s'
2017-07-19 09:03:51 +09:00
Yukihiro "Matz" Matsumoto
14a72b0800
Avoid constant-set duplication; ref #3747
2017-07-19 09:03:07 +09:00
Yukihiro "Matz" Matsumoto
a8bffdae50
Merge branch 'const_set_mod_to_s' of https://github.com/christopheraue/mruby into christopheraue-const_set_mod_to_s
2017-07-19 08:58:06 +09:00
Christopher Aue
468cc34c93
Fixed Module#to_s and #name for #const_set modules
2017-07-18 22:55:37 +02:00
Christopher Aue
dd52b88101
implemented Module#singleton_class?
2017-07-18 20:47:05 +02:00
Yukihiro "Matz" Matsumoto
329938ef15
Simplify mrb_gc_arena_restore() to reduce overhead.
...
It will no longer shrink arena region. Instead `vm.c` uses
a static function `mrb_gc_arena_shrink()` to shrink.
2017-07-18 23:26:36 +09:00
Yukihiro "Matz" Matsumoto
52aafcd001
Merge pull request #3743 from christopheraue/sprintf_d_tests
...
added tests for #3736
2017-07-17 09:17:24 +09:00
Yukihiro "Matz" Matsumoto
59eaad9d78
Merge pull request #3742 from christopheraue/iter_exp_tests
...
added basic tests for while/until/break/next
2017-07-17 09:16:25 +09:00
Christopher Aue
2730231e50
added tests for #3736
2017-07-16 22:34:23 +02:00
Christopher Aue
8fe2a6ce0f
added basic tests for while/until/break/next
2017-07-16 22:25:48 +02:00
Yukihiro "Matz" Matsumoto
515a093213
Add Hash#transform_keys! and Hash#transform_values.
2017-07-15 08:51:35 +09:00
Yukihiro "Matz" Matsumoto
d7fef24a95
Use keys.each instead of unstable each_keys.
2017-07-15 08:50:52 +09:00
Yukihiro "Matz" Matsumoto
460d628490
Remove duplication in mruby-hash-ext test.
2017-07-14 16:10:26 +09:00
Yukihiro "Matz" Matsumoto
1c02b8558f
Avoid duplicated width filling for sprintf %d specifier; fix #3736
2017-07-14 15:21:11 +09:00
Yukihiro "Matz" Matsumoto
de3edcc170
Add Hash#transform_{keys,values} to mruby-hash-ext.
2017-07-14 15:13:41 +09:00
Yukihiro "Matz" Matsumoto
bad807e7f0
Use floor() to implement round() on WIN32 platform.
...
This change was suggested by Akira Kakuto.
2017-07-13 20:32:34 +09:00
Yukihiro "Matz" Matsumoto
70e99d6b57
Define round() only on WIN32 platform; fix #3741
2017-07-13 00:09:31 +09:00
Yukihiro "Matz" Matsumoto
7fa9321c18
while|until should have the value from break; fix #3735
2017-07-12 14:56:48 +09:00
Yukihiro "Matz" Matsumoto
e5fbe350b3
Avoid float operation to shrink arena buffer size.
2017-07-12 14:52:03 +09:00
Yukihiro "Matz" Matsumoto
9501b18362
Add inline modifier to cipush() and cipop() functions.
2017-07-12 14:50:44 +09:00
Yukihiro "Matz" Matsumoto
a18904a4c2
Use "$!" specifier of mrb_get_args.
2017-07-12 14:49:55 +09:00
Yukihiro "Matz" Matsumoto
e9b57124a0
Update mrb_get_args() document.
2017-07-12 14:49:06 +09:00
Yukihiro "Matz" Matsumoto
adf453a584
Add "*!" argument specifier to avoid stack copying.
2017-07-12 14:48:23 +09:00
Yukihiro "Matz" Matsumoto
059d707e3a
Add ary_modify_check() to Array#unshift; ref #3737
2017-07-12 14:44:36 +09:00
Yukihiro "Matz" Matsumoto
e1de86134d
Merge pull request #3740 from christopheraue/fix_test_output
...
fixed printing failed assertions
2017-07-12 08:24:02 +09:00
Christopher Aue
495a2e605d
fixed printing failed assertions
2017-07-11 12:53:48 +02:00
Yukihiro "Matz" Matsumoto
fc666bfe20
POSFIXABLE and NEGFIXABLE should take one argument.
2017-07-11 09:02:24 +09:00
Yukihiro "Matz" Matsumoto
46dee5716f
Resurrect POSFIXABLE and NEGFIXABLE; ref 9186828
2017-07-10 09:42:48 +09:00
Yukihiro "Matz" Matsumoto
01fce3dc35
Merge pull request #3739 from ksss/array-shift
...
Should only check frozen fix #3737
2017-07-09 19:58:11 +09:00
ksss
bf48473cf6
Should only check frozen for Array#pop
2017-07-09 18:05:21 +09:00
ksss
c76dc33116
Add frozen test for Array#shift
2017-07-09 17:53:12 +09:00
ksss
e581f2ed97
Should only check frozen fix #3737
2017-07-09 17:47:10 +09:00
Yukihiro "Matz" Matsumoto
ce6c05600a
Add fallback definitions of DBL_EPSILPN and LDBL_EPSILON; fix #3733
...
This is a workaround for mingw-w64 (5.3.1) bug.
2017-07-07 22:47:49 +09:00
Yukihiro "Matz" Matsumoto
718a9ceb6e
Reduce allocation size of backtrace arrays.
2017-07-06 09:33:53 +09:00
Yukihiro "Matz" Matsumoto
542f0f7b16
Avoid out-of-bounds access of the backtrace array.
2017-07-06 09:32:28 +09:00
Yukihiro "Matz" Matsumoto
91868286be
FIXABLE_FLOAT() fails sometimes in MRB_INT64 environment.
2017-07-06 09:05:46 +09:00
Yukihiro "Matz" Matsumoto
cc04f03393
print("%d", 0) should not print -0; fix #3731
2017-07-05 23:31:50 +09:00
Yukihiro "Matz" Matsumoto
2ef5d22b60
Put a space between error position and error message.
...
For readability's sake.
2017-07-05 18:34:27 +09:00
Yukihiro "Matz" Matsumoto
b68e7a605c
Negation was not a good way to handle negative integers; fix #3729
...
There's a number that negation does not work (-2147483648 in 32bit
environment).
2017-07-05 18:13:37 +09:00
Yukihiro "Matz" Matsumoto
b643a1a8bc
In Ruby, sprintf specifier %u should behave as %d; fix #3730
...
Since there's no unsigned integer in Ruby. Binary, octal and
hexadecimal negative numbers can be represented by using 2's
compliment. But decimal (not being power of 2) cannot be use
that kind of format.
2017-07-05 17:48:40 +09:00
Yukihiro "Matz" Matsumoto
bd66c5d716
Check stack size before accessing env stack; fix #3727
2017-07-05 09:19:06 +09:00
Yukihiro "Matz" Matsumoto
cc01dedc65
Avoid undefined behavior of left shifting negative integer; #3728
2017-07-05 03:11:39 +09:00
Yukihiro "Matz" Matsumoto
c377d504f6
Avoid undefined behavior of signed integer overflow; fix #3728
2017-07-05 03:11:39 +09:00
Yukihiro "Matz" Matsumoto
c6bd8ceab7
Merge pull request #3726 from mruby/stable
...
mruby-1.3.0
2017-07-04 15:46:38 +09:00
Yukihiro "Matz" Matsumoto
e9cdc88008
Refactor sprintf() code.
2017-07-04 08:50:39 +09:00
Yukihiro "Matz" Matsumoto
31bc2b0009
Initialize flags for each loop.
2017-07-04 08:46:33 +09:00
Yukihiro "Matz" Matsumoto
9b8956cdd0
break should not cross fiber-context boundary; fix #3724
2017-07-01 12:45:27 +09:00
Yukihiro "Matz" Matsumoto
7d99830211
super may be called from a block; fix #3723
2017-07-01 12:45:27 +09:00
Yukihiro "Matz" Matsumoto
466a18b0d3
Remove redundant use of Object#to_s in interpolation.
2017-06-28 23:28:24 +09:00
Yukihiro "Matz" Matsumoto
aee1476ebd
Provide better way to check compile errors.
...
Now you can just call `mrb_load_*` functions then check
`context->parser_nerr > 0` if the return value is `undef`,
instead of calling `mrb_parse_*` functions independently.
ref #3248 #3331
2017-06-28 16:04:40 +09:00
Yukihiro "Matz" Matsumoto
15945e14b9
Revert "Make mrb_load_exec a static function."
...
This reverts commit 7944d9a6d4 .
Because it voids #3248 and #3331 . But we should add better way
to check whether compile errors occur without duplicated callings.
2017-06-28 16:00:59 +09:00
Yukihiro "Matz" Matsumoto
f0abd4241f
Avoid mrb_funcall() unless absolutely necessary; ref #3722
...
As a result, `#chr` is not called for ch < 0x80, so we need to
update the "invalid chr" test.
2017-06-28 12:03:53 +09:00
Yukihiro "Matz" Matsumoto
3554a41a54
Remove unnecessary initialization of a local variable.
2017-06-27 22:48:06 +09:00
Yukihiro "Matz" Matsumoto
877e16501c
No longer need to copy argv from mrb_get_args; ref #3722
2017-06-27 22:47:26 +09:00
Yukihiro "Matz" Matsumoto
1a3b32343e
Copy argv from VM stack to avoid use-after-free; fix #3722
2017-06-27 22:43:37 +09:00
Yukihiro "Matz" Matsumoto
b30eba6a13
Make LocalJumpError a subclass of ScriptError.
...
It's incompatible with CRuby, but it is required for mruby because
it cannot detect `break` outside of loops in the parsing time, but
in the code generation time where it cannot raise `SyntaxError`.
2017-06-23 18:08:38 +09:00
Yukihiro "Matz" Matsumoto
d0717efda6
Should raise an exception if break called in ensure; fix #3721
2017-06-23 18:08:04 +09:00
Yukihiro "Matz" Matsumoto
7944d9a6d4
Make mrb_load_exec a static function.
2017-06-23 17:56:12 +09:00
Yukihiro "Matz" Matsumoto
9a59cd7af8
Silence mrbmemcpy and mrbmemset warnings.
2017-06-23 17:54:02 +09:00
Yukihiro "Matz" Matsumoto
b200c7475a
No need to mark stacks of terminated fibers; fix #3720
2017-06-22 02:05:14 +09:00
Yukihiro "Matz" Matsumoto
c41e262667
Add write barrier to protect singleton class from GC; fix #3717
2017-06-22 01:20:22 +09:00
Yukihiro "Matz" Matsumoto
af0bef6dd8
Silence rubocop warnings.
2017-06-22 00:27:17 +09:00
Yukihiro "Matz" Matsumoto
e8a4e4262a
Add write barrier to protect proc reference from fiber; fix #3719
2017-06-21 17:59:14 +09:00
Yukihiro "Matz" Matsumoto
464d3fc0a3
Use alias enum_for to_enum instead of alias :enum_for :to_enum.
2017-06-21 11:13:43 +09:00
Yukihiro "Matz" Matsumoto
057be5ffb5
use unless instead of if not.
2017-06-21 11:13:33 +09:00
Yukihiro "Matz" Matsumoto
d0a7e01d9c
Should call ecall() before callinfo adjustment; fix #3715
2017-06-21 02:51:55 +09:00
Yukihiro "Matz" Matsumoto
bf1cb87b34
Array size can be cause integer overflow; fix #3710
2017-06-20 20:19:37 +09:00
Yukihiro "Matz" Matsumoto
39779b339e
Merge pull request #3718 from miura1729/original
...
#3711 fix
2017-06-20 16:18:07 +09:00
Miura Hideki
0fa94f9ead
#3711 fix
2017-06-20 12:50:00 +09:00
Yukihiro "Matz" Matsumoto
615e7e44e3
Avoid using snprintf(3) in case MRB_DISABLE_STDIO; fix #3714
2017-06-20 09:39:33 +09:00
Yukihiro "Matz" Matsumoto
455f3954dc
Merge pull request #3713 from Asmod4n/patch-2
...
Save gc_arena after buffer got allocated
2017-06-20 09:16:38 +09:00
Asmod4n
abca63c73b
Save gc_arena after buffer got allocated
...
Latest fix was freeing the buffer while it was still in use.
Fixes #3712
2017-06-19 20:27:38 +02:00
Tomoyuki Sahara
04774e5bf2
remove unused exception variables.
2017-06-15 11:00:26 +09:00
Tomoyuki Sahara
7c62d89348
Merge pull request #88 from christopheraue/master
...
Fix for IO#read(n) with n > IO::BUF_SIZE
2017-06-15 10:53:01 +09:00
Christopher Aue
3642fe4013
fixed #87 : IO#read(n) with n > IO::BUF_SIZE
2017-06-13 21:40:36 +02:00
Tomoyuki Sahara
81a0dcdb7a
sizeof(optval) must be 1 for IP_MULTICAST_TTL & IP_MULTICAST_LOOP. fixes #34 .
2017-06-13 12:13:04 +09:00
Tomoyuki Sahara
fe99819bc9
Merge pull request #85 from ksss/read
...
Support outbuf argument for IO#read
2017-06-12 16:17:53 +09:00
Tomoyuki Sahara
c279f00109
Merge pull request #86 from ksss/write
...
Reseek when write
2017-06-12 16:15:31 +09:00
Tomoyuki Sahara
0b41066e83
Merge pull request #84 from ksss/pos
...
To accurate `pos`
2017-06-12 15:43:44 +09:00
ksss
051d7bc8db
Reseek when write
2017-06-12 09:57:18 +09:00
ksss
1ebe1c8b1f
Support outbuf argument for IO#read
2017-06-12 09:43:02 +09:00
ksss
27f422880f
To accurate pos
...
pos shouldn't cache because it's not controllable
2017-06-11 23:22:04 +09:00
Tomoyuki Sahara
3a73a58493
mruby 1.2.0 assumes test blocks return their results. master does not.
2017-06-07 11:36:37 +09:00
Tomoyuki Sahara
383a9c79e1
Merge pull request #13 from ksss/unpack-utf8
...
Support unpack template "U"
2017-06-07 11:09:43 +09:00
Tomoyuki Sahara
dab87cf960
Merge pull request #80 from ksss/sysread
...
IO#sysread Check for readable
2017-06-05 16:21:30 +09:00
ksss
a3a4f4d061
IO#sysread Check for readable
2017-05-27 13:34:11 +09:00
Tomoyuki Sahara
0c0b34136e
Merge pull request #78 from ksss/syswrite
...
Should raise SyscallError on IO#syswrite
2017-05-23 15:09:04 +09:00
Tomoyuki Sahara
87771ecf92
Merge pull request #79 from ksss/ioerror
...
Fix some spec for IO#sysread
2017-05-23 15:06:15 +09:00
ksss
0bbd60b523
IO#sysread should raise error when invalid pos
2017-05-22 11:47:45 +09:00
ksss
86edc9ab85
IO#sysread should raise IOError when closed
2017-05-21 22:54:46 +09:00
ksss
844b2c368f
IO#sysread with 0 always return empty string
2017-05-21 22:54:12 +09:00
ksss
c43795c664
Should raise SyscallError on IO#syswrite
...
instead of IOError
2017-05-21 17:10:15 +09:00
Tomoyuki Sahara
6836f424c5
"open" error message should include pathname. fixes #77 .
2017-05-19 17:14:43 +09:00
Tomoyuki Sahara
728d313b2c
Merge pull request #76 from yyamano/issue-75
...
Make backquote work with the latest mruby. Fixed #75
2017-04-25 11:19:07 +09:00
Yuji Yamano
311f4a230f
Make backquote work with the latest mruby. Fixed #75
2017-04-24 02:40:01 -04:00
Tomoyuki Sahara
7e014efe45
Merge pull request #14 from ksss/to_int
...
Should use `to_int` instead of `to_i`
2017-04-06 10:25:06 +09:00
Uchio KONDO
38db5e550f
Some adjustments
2017-04-04 12:16:53 +09:00
Uchio KONDO
9c2db2e134
Move class/module definitions to normal .rb files
2017-04-04 12:03:43 +09:00
Uchio KONDO
86b69d7c5d
Initial skelton for class/module def
2017-04-04 11:57:17 +09:00
ksss
d83e15e866
Should use to_int instead of to_i
...
For CRuby compatibility
2017-04-04 11:19:43 +09:00
ksss
0dbd1d5992
Add "U" template to doc
2017-04-04 11:07:15 +09:00
ksss
f691a73c26
Should raise RangeError
2017-04-04 11:07:14 +09:00
ksss
a80a745b69
Support unpack template "U"
2017-04-04 10:06:30 +09:00
Tomoyuki Sahara
f8a3af8086
Merge pull request #74 from iij/run-test-outside-source-tree
...
run mrbtest outside of source tree.
2017-02-28 12:34:15 +09:00
Tomoyuki Sahara
3ae5fea2b8
run mrbtest outside of source tree.
2017-02-28 12:10:51 +09:00
Tomoyuki Sahara
74fe87c289
Add a travis-ci badge.
2017-02-17 10:33:11 +09:00
Tomoyuki Sahara
86d58a2d37
File class does not have to include Enumerable.
...
Because IO class, which is the superclass of File class, includes it.
2017-02-10 11:22:52 +09:00
Tomoyuki Sahara
88a7fedea4
support "x".
2017-02-09 11:07:55 +09:00
Tomoyuki Sahara
3dad125a1c
TCPSocket.new supports "local_host" and "local_service".
2017-02-08 19:04:11 +09:00
Tomoyuki Sahara
caab1c203c
define IO#hash to override Enumerable#hash. fixes #73 .
...
Current implementation of Enumerable#hash calls #each to collect
hash values of enumerated objects (then calculates the hash value
of the Enumerable object). But IO#each is a method to read lines.
It is not expected that IO#hash reads all lines from the IO object.
Or even worse, program waits for the IO object to be readable if
it is a socket or something cannot be read immediately.
2017-02-08 18:31:50 +09:00
Tomoyuki Sahara
69623078a8
Merge pull request #72 from masahino/add_pointer_casting
...
Add pointer casting
2016-12-26 09:12:19 +09:00
masahino
1fac605e3f
Add pointer casting
2016-12-24 23:32:44 +09:00
Tomoyuki Sahara
458b517c6f
Merge pull request #71 from eagletmt/readlink
...
Add File.readlink
2016-12-19 09:03:13 +09:00
Kohei Suzuki
b31b8022db
Fix memory leak in error case
2016-12-17 16:48:02 +09:00
Kohei Suzuki
d1c48192cb
Add File.readlink
2016-12-17 15:03:52 +09:00
Tomoyuki Sahara
7e89736291
Merge pull request #70 from eagletmt/chmod
...
Add File.chmod
2016-12-16 22:54:20 +09:00
Kohei Suzuki
698378f076
Add File.chmod
2016-12-16 01:20:08 +09:00
Tomoyuki Sahara
f2d4880098
Merge pull request #11 from masahino/add_casting
...
Add pointer casting
2016-12-12 06:51:03 +09:00
masahino
906b516cfa
Add pointer casting
2016-12-09 21:57:06 +09:00
Tomoyuki Sahara
0eafb089c9
Merge pull request #69 from eagletmt/explicit-cast
...
Add explicit cast from void* to struct mrb_io*
2016-11-27 13:53:50 +09:00
Kohei Suzuki
905203ef5e
Add explicit cast from void* to struct mrb_io*
...
For compatibility with C++.
2016-11-26 14:18:28 +09:00
Tomoyuki Sahara
b5e2dc9097
raise an exception when we cannot close "fd" but can close "fd2".
2016-10-13 16:57:38 +09:00
Tomoyuki Sahara
f6a82772e6
eof? should raise an IOError if it is not opened for reading.
2016-09-30 17:10:55 +09:00
Tomoyuki Sahara
2229a2aa0f
reimplement #eof. fixes #66 .
2016-09-30 16:27:11 +09:00
Tomoyuki Sahara
51cf6b6048
Merge pull request #65 from ksss/join
...
Support Array argument
2016-09-13 09:57:05 +09:00
ksss
ff845be72c
Support Array argument
2016-09-11 22:01:45 +09:00
ksss
7c9d941003
Show value of expect and actual each assertion
2016-09-11 17:00:19 +09:00
Tomoyuki Sahara
d8189c2b19
Merge pull request #64 from asfluido/master
...
Apparently, in mruby-process gem, Process is now a Module, not a Class
2016-08-10 09:12:44 +09:00
Carlo - PERI
024b09de0c
Apparently, in mruby-process gem, Process is now a Module, not a Class
2016-08-09 11:23:49 +02:00
Tomoyuki Sahara
b341ee7c12
Merge pull request #63 from ksss/opt
...
Enable option :in, :out, :err to IO.popen
2016-08-08 10:12:20 +09:00
Tomoyuki Sahara
9ccf03e5ae
Merge pull request #62 from ksss/global
...
Should use global variable
2016-08-08 09:38:22 +09:00
ksss
d2c1f4d10b
Enable Fixnum option
2016-08-07 22:19:21 +09:00
ksss
b462ef4506
Enable option :in, :out, :err
2016-08-07 21:21:01 +09:00
ksss
4cac5e9c70
Should use global variable
2016-08-06 23:11:31 +09:00
Tomoyuki Sahara
cc66bf94d1
Merge pull request #9 from ksss/pointer-sign
...
Suppress compiler warning [-Wpointer-sign]
2016-07-19 09:45:32 +09:00
Tomoyuki Sahara
13650747e7
Merge pull request #10 from dabroz/master
...
Added 'U' pack support.
2016-07-19 09:44:14 +09:00
Tomasz Dąbrowski
26c1dedcab
Added 'U' pack support.
2016-07-18 16:06:01 +02:00
ksss
b9f7daf5b6
Suppress compiler warning [-Wpointer-sign]
2016-07-01 22:27:02 +09:00
Tomoyuki Sahara
93d481d4b4
update $? when IO object is closed. closes #58 .
2016-06-22 10:29:49 +09:00
Tomoyuki Sahara
e90ecff671
Merge pull request #60 from drbrain/test_io_setup_failure
...
Test io setup failure
2016-06-21 09:52:30 +09:00
Tomoyuki Sahara
2af2a4fff8
add IO#isatty and IO#tty?
2016-06-21 09:49:34 +09:00
Tomoyuki Sahara
b2a0c9c6bf
Merge pull request #30 from rhykw/tcpserver-reuseaddr
...
Use TCPServer SO_REUSEADDR
2016-05-30 10:42:30 +09:00
rhykw
4f6703203b
TCPServer use SO_REUSEADDR if possible
2016-05-28 09:33:53 +09:00
rhykw
2a80cccf30
TCPServer use SO_REUSEADDR
2016-05-23 21:44:34 +09:00
Eric Hodel
11961b42ac
Create socket in /tmp for security
...
Some systems do not allow UNIX sockets from arbitrary directories.
Instead of trying to `#define SOCKET_PATH` correctly I assume the /tmp/
directory is accessible and use it.
2016-05-12 17:55:14 -07:00
Eric Hodel
777cf70cc5
Include reason in test failure message
...
I am seeing this test fail in some environments but can't determine why.
The extra information will help me determine the reason bind(2) is
failing.
2016-05-12 16:02:09 -07:00
Tomoyuki Sahara
18f7b45ad1
Merge pull request #29 from rmalizia44/patch-1
...
Add _WIN32_WINNT definition to Avoid Windows Compilation Errors
2016-01-30 22:39:20 +09:00
rmalizia44
be2ec608e2
Add _WIN32_WINNT definition to Avoid Windows Compilation Errors
...
the line #define _WIN32_WINNT 0x0501 will cause ws2tcpip.h to implement the missing functions freeaddrinfo, getaddrinfo and getnameinfo on windows
2016-01-28 03:28:05 -02:00
Tomoyuki Sahara
1c4428880b
Merge pull request #57 from MaximAbramchuck/patch-1
...
Add installation instructions
2016-01-21 22:09:17 +09:00
Maxim Abramchuk
7d6f2beaaa
Add installation instructions
2016-01-20 13:40:30 +03:00
Tomoyuki Sahara
c165e50193
Merge pull request #28 from zzak/port-ntop-pton-win32
...
Port inet_ntop and inet_pton for WIN32
2016-01-18 16:12:35 +09:00
Tomoyuki Sahara
a25ec0a749
Merge pull request #27 from zzak/fix-udpsock-warning
...
Fix warning: variable 'udpsock' set but not used
2016-01-18 16:09:55 +09:00
Zachary Scott
bdc118304c
Port inet_ntop and inet_pton for WIN32
...
Without these functions, compilation fails on MinGW
2016-01-18 15:34:26 +09:00
Zachary Scott
c8a2c636e0
Fix warning: variable 'udpsock' set but not used
2016-01-18 15:27:32 +09:00
Tomoyuki Sahara
99e10b8dc4
File::ALT_SEPARATOR is always defined (some string or nil).
2015-12-08 16:44:13 +09:00
Tomoyuki Sahara
4acfd1c7d2
Merge pull request #56 from takahashim/fix-flock
...
Fix for windows(mingw)
2015-12-08 12:55:38 +09:00
takahashim
dd754220ce
Fix for windows(mingw)
...
* File.expand_path: support drive letter and ALT_SEPARATOR
* File.dirname: support ALT_SEPARATOR
* File.basename: ditto.
* IO.popen: raise NotImplementedError
* IO.pipe: ditto.
* `cmd`: ditto.
* File#flock: ditto.
* FileTest.pipe?: ditto.
* FileTest.symlink?: ditto.
* FileTest.socket?: ditto.
2015-12-08 00:29:42 +09:00
Tomoyuki Sahara
68de1e4fc5
Merge pull request #55 from takahashim/separator
...
fix file separator
2015-12-07 16:00:46 +09:00
takahashim
0f5b8b66b0
fix file separator
...
* File::SEPARATOR should be "/"
* File::ALT_SEPARATOR should be "\\" or nil.
2015-12-04 15:36:41 +09:00
Tomoyuki Sahara
6c67120ed4
Merge pull request #54 from takahashim/win-crlf
...
fix tests for Win: use binary mode
2015-12-03 12:22:59 +09:00
takahashim
b19c315148
fix tests for Win: use binary mode
2015-12-02 21:47:46 +09:00
Tomoyuki Sahara
7337bfa497
Merge pull request #53 from takahashim/build-win32
...
build on Win32
2015-12-02 10:13:15 +09:00
takahashim
07ceb138fa
build on Win32
2015-12-02 00:10:43 +09:00
Tomoyuki Sahara
07f1ebd26d
symlink(2) returns -1 when it fails.
2015-11-24 17:09:00 +09:00
Tomoyuki Sahara
11ffb93852
assert_nothing_raised is not available on mruby 1.0.0.
2015-11-24 17:00:12 +09:00
Tomoyuki Sahara
ca495944b6
Merge pull request #51 from ksss/io-pipe
...
Implement IO.pipe
2015-11-24 16:49:34 +09:00
ksss
a55accd736
Implement IO.pipe
2015-11-24 14:24:24 +09:00
Tomoyuki Sahara
c9a4091b83
arguments can be shared strings.
2015-11-24 09:54:03 +09:00
Tomoyuki Sahara
1f4bd9fd9f
Merge pull request #50 from takahashim/file-symlink
...
add File.symlink
2015-11-24 09:47:09 +09:00
takahashim
2cc674e58e
add File.symlink
2015-11-22 13:13:52 +09:00
Tomoyuki Sahara
14cdff075d
Merge pull request #48 from takahashim/file-path
...
add File.path
2015-11-22 07:12:23 +09:00
takahashim
44473fecdd
add File.path
2015-11-21 22:03:40 +09:00
Tomoyuki Sahara
828551f86c
off_t can be larger than mrb_int.
2015-10-20 16:03:02 +09:00
Tomoyuki Sahara
db7d829679
raise a SystemCallError when lseek(2) fails.
2015-10-20 15:40:25 +09:00
Tomoyuki Sahara
21963f8fa1
UT for IO#sysseek.
2015-10-20 15:37:05 +09:00
Tomoyuki Sahara
cac0035348
fix typo.
2015-10-20 15:16:46 +09:00
Tomoyuki Sahara
78fe65aec4
Merge branch 'master' of github.com:iij/mruby-io
2015-10-20 15:13:28 +09:00
Tomoyuki Sahara
71197d2737
Merge pull request #47 from matsumoto-r/patch-1
...
Fix buffer overflow of `pos` when file-size is too big
2015-10-19 19:33:09 +09:00
MATSUMOTO, Ryosuke
238704592a
Fix buffer overflow of pos when file-size is too big
2015-10-19 19:24:39 +09:00
Tomoyuki Sahara
e724c5af98
Merge pull request #45 from takahashim/enable-test
...
enable test
2015-09-28 12:25:33 +09:00
Tomoyuki Sahara
1f217ea82e
Merge pull request #46 from takahashim/add-rewind
...
support IO#rewind
2015-09-28 12:24:51 +09:00
takahashim
9bbfc38bb4
add IO#rewind
2015-09-27 21:25:06 +09:00
Tomoyuki Sahara
1d6b7f9bba
Merge pull request #44 from takahashim/io-addstr
...
support IO#<<
2015-09-27 21:15:54 +09:00
takahashim
f5560e8f17
enable test
2015-09-27 01:39:11 +09:00
takahashim
c26f998ed5
support IO#<<
2015-09-27 00:29:17 +09:00
Tomoyuki Sahara
625995424c
To run test, we need "conf.enable_test" in build_config.rb.
2015-09-08 13:25:05 +09:00
Tomoyuki Sahara
f3016752bd
build in container-based environment.
2015-09-08 13:23:46 +09:00
Tomoyuki Sahara
ecd7ef5924
Revert "try to fix failure on travis."
...
This reverts commit 02daa2509d .
2015-09-08 11:57:08 +09:00
Tomoyuki Sahara
02daa2509d
try to fix failure on travis.
2015-09-08 10:44:08 +09:00
Tomoyuki Sahara
5fa3c39145
variables are not used on the platforms lack FD_CLOEXEC.
2015-08-27 09:56:17 +09:00
Tomoyuki Sahara
6c4d39412f
Merge pull request #30 from ksss/cloexec
...
Opened fd should be set FD_CLOEXEC by default
2015-08-26 17:37:21 +09:00
Tomoyuki Sahara
042e4a4313
Merge pull request #43 from jkutner/master
...
Made FILE_SEPERATOR platform dependent
2015-08-21 09:20:32 +09:00
Joe Kutner
2467332c93
Made FILE_SEPERATOR platform dependent
2015-08-20 07:22:48 -05:00
Tomoyuki Sahara
efaf74672e
Merge pull request #42 from hone/path_separator
...
define PATH_SEPARATOR
2015-08-12 09:06:34 +09:00
Tomoyuki Sahara
5323498033
Merge pull request #23 from expeditiousRubyist/master
...
Changed Windows IO overrides to use sysread and syswrite instead
2015-08-10 10:36:14 +09:00
Tomoyuki Sahara
e8efd10bd9
make pack_l simpler.
2015-08-07 11:51:01 +09:00
Tomoyuki Sahara
4603047eb1
update installation procedure.
2015-08-07 11:49:56 +09:00
Tomoyuki Sahara
359d2ae6fd
support "q" and "Q". closes #7 .
2015-08-07 11:48:45 +09:00
Tomoyuki Sahara
d34db58797
implicit type conversion caused unexpected result. fixes #8 .
2015-08-06 15:38:35 +09:00
unknown
c43a08314e
Changed IO overrides to use sysread and syswrite instead of read and write
2015-08-03 04:12:10 -07:00
Terence Lee
ec4982b2d3
define PATH_SEPARATOR
2015-08-02 17:35:07 +02:00
Tomoyuki Sahara
8527c78fb5
Merge pull request #22 from Asmod4n/master
...
added SO_NOSIGPIPE
2015-07-28 09:00:31 +09:00
Asmod4n
2929c629d4
added SO_NOSIGPIPE
2015-07-27 18:42:22 +02:00
Tomoyuki Sahara
de60400c64
Merge pull request #21 from expeditiousRubyist/master
...
Added functioning read for Win32
2015-07-25 20:09:20 +09:00
Rubyist
f80a4fd0e8
Added functioning read for Win32
2015-07-25 00:24:31 -07:00
Tomoyuki Sahara
2d1134e9ea
Merge pull request #41 from hone/cross_compile_windows
...
support for crossbuild for windows (32 bit and 64 bit) using mingw
2015-07-24 09:19:56 +09:00
Terence Lee
fe7784efb0
support for crossbuild for windows (32 bit and 64 bit) using mingw
2015-07-23 12:39:05 -05:00
Tomoyuki Sahara
bfb9cf7922
Merge pull request #20 from expeditiousRubyist/master
...
Win32 Port
2015-07-22 09:35:39 +09:00
Rubyist
4ab922044d
Removed unnecessary/incorrect use of sizeof(int) and corrected more
...
improper usages of mrb_sys_fail
2015-07-21 15:56:27 -07:00
Rubyist
7ee9ab89f9
Changed some uses of mrb_sys_fail to instead use mrb_raise where
...
appropriate
2015-07-21 03:37:28 -07:00
Rubyist
a426f0e2b5
Overrided close and write to work on Win32 platforms
2015-07-18 23:22:57 -07:00
Rubyist
752f7c1526
Minimal semi-working compile on Windows platforms.
2015-07-17 23:45:02 -07:00
Rubyist
7d8cbf1a9c
Added Winsock 2 to list of libraries to use when building for Windows
...
targets
2015-07-17 23:03:34 -07:00
Tomoyuki Sahara
1b5c68567e
Merge pull request #40 from archSeer/patch-1
...
Remove mrb_io_s_select typo.
2015-07-03 09:36:49 +09:00
Blaž Hrastnik
8da787be72
Remove mrb_io_s_select typo.
...
Uncovered with a Coverity scan of our project using mruby-io. https://scan8.coverity.com/reports.htm#v26153/p11375/fileInstanceId=6844382&defectInstanceId=2515905&mergedDefectId=121921
2015-07-02 21:02:56 +02:00
Tomoyuki Sahara
b913e7eefd
test suite for pack/unpack.
2015-05-22 11:38:56 +09:00
Tomoyuki Sahara
2ba4933158
refactor "AaZ". fixes #6 .
2015-05-22 11:38:39 +09:00
Tomoyuki Sahara
15de80a7cd
style.
2015-05-22 09:41:39 +09:00
Tomoyuki Sahara
dacb8b626b
failed to remove temporary files!
2015-05-20 11:38:03 +09:00
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
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
Tomoyuki Sahara
1629e86063
add IPv6 constants defined in RFC3493.
2015-02-13 11:35:36 +09:00
Tomoyuki Sahara
e4006cb53a
Socket::Option requires iij/mruby-pack.
2014-12-26 16:12:41 +09:00
Tomoyuki Sahara
0d05a22602
don't call undefined method. fixes #15 .
2014-12-26 16:00:50 +09:00
Tomoyuki Sahara
7b17158f88
remove unused variables.
2014-12-26 13:36:11 +09:00
Tomoyuki Sahara
a09858af61
syscalls may return sockaddr shorter than sizeof(struct sockaddr) on Linux.
2014-12-26 13:27:39 +09:00
Tomoyuki Sahara
a960a6f931
failed to add...
2014-12-26 11:19:53 +09:00
Tomoyuki Sahara
3a22166c67
debug UNIXSocket and UNIXServer.
2014-12-26 11:16:03 +09:00
Tomoyuki Sahara
3a97a453c4
rewrite IO.for_fd.
...
IO.for_fd should call IO#initialize to initialize the created object
properly. It cannot be implemented in Ruby.
2014-12-26 11:09:07 +09:00
Tomoyuki Sahara
c455544ee2
better error message.
2014-12-26 11:08:18 +09:00
Tomoyuki Sahara
1d1f273ca9
Merge pull request #35 from tmtm/fix-read-create-many-objects
...
FIX: IO#read create a large number of objects.
2014-12-18 11:33:06 +09:00
TOMITA Masahiro
42752bffce
FIX: IO#read create a large number of objects.
2014-12-18 00:41:59 +09:00
Tomoyuki Sahara
e7dbe6e87a
Merge pull request #33 from iij/revert-32-fix-read-create-many-objects
...
Revert "FIX: IO#read create a large number of objects."
2014-12-17 13:39:59 +09:00
Tomoyuki Sahara
e82c1d3f38
Revert "FIX: IO#read create a large number of objects."
2014-12-17 13:37:15 +09:00
Tomoyuki Sahara
50721e9bf8
Merge pull request #32 from tmtm/fix-read-create-many-objects
...
FIX: IO#read create a large number of objects.
2014-12-17 13:35:34 +09:00
TOMITA Masahiro
9b13a59a55
FIX: IO#read create a large number of objects.
2014-12-17 01:46:23 +09:00
Tomoyuki Sahara
ee347f3417
Merge pull request #31 from tmtm/fix-sysread-segv
...
FIX: IO#sysread occurs SEGV
2014-12-16 09:07:45 +09:00
TOMITA Masahiro
be9e203563
FIX: IO#sysread occurs SEGV
2014-12-15 20:24:01 +09:00
Tomoyuki Sahara
723db886e1
add Socket::Option#inspect
...
without this, mirb dies.
https://github.com/mruby/mruby/pull/2666
2014-12-12 12:38:43 +09:00
Tomoyuki Sahara
121475638d
add "I" and "i".
2014-12-12 12:12:41 +09:00
Tomoyuki Sahara
2103bc99ba
style
2014-12-12 12:12:19 +09:00
Tomoyuki Sahara
669fe705cc
"i" and "I".
2014-12-12 12:01:58 +09:00
ksss
e61c469724
IO.popen fd set close_on_exec flag by default
2014-12-04 10:25:03 +09:00
ksss
9439b981d8
Opened fd should be set FD_CLOEXEC by default
2014-12-04 10:25:03 +09:00
Tomoyuki Sahara
d1fee5892a
IO.sysopen does retry. closes #26 .
2014-11-25 16:26:34 +09:00
Tomoyuki Sahara
e7cd024498
Merge pull request #29 from sdottaka/fix-for-msvc
...
Fix broken build for Visual C++
2014-11-25 10:29:07 +09:00
sdottaka
24007b80b4
Fix broken build for Visual C++
2014-11-22 17:48:59 +09:00
Tomoyuki Sahara
a2f45bf8d1
Merge pull request #28 from ksss/file-size
...
Implement FileTest.size
2014-11-18 10:35:12 +09:00
ksss
a44ada616e
Implement FileTest.size
...
- File.size delegate to FileTest.size
- File.size more faster by reading i-node value
2014-11-16 14:55:45 +09:00
Tomoyuki Sahara
379c5a6d88
Merge pull request #25 from matz/gc_on_enfile
...
garbage collect when open(2) fails with ENFILE or EMFILE
2014-11-13 09:27:11 +09:00
Yukihiro "Matz" Matsumoto
b50093ad28
garbage collect when open(2) fails with ENFILE or EMFILE
2014-11-13 01:50:46 +09:00
Tomoyuki Sahara
190264b3c8
Merge pull request #23 from jbreeden/master
...
Correcting E_NOTIMP_ERROR reference
2014-08-08 21:34:15 +09:00
Akito Mochizuki
0761b17245
update implemented methods table
2014-08-05 11:51:05 +09:00
jbreeden
9a2cbc4122
Correcting E_NOTIMP_ERROR reference
2014-08-03 16:45:46 -04:00
Tomoyuki Sahara
e60951a305
add IO#sync and IO#sync=
2014-07-29 10:55:02 +09:00
Tomoyuki Sahara
1768ee02e5
remove extra ';'.
2014-07-22 23:55:25 +09:00
Tomoyuki Sahara
8c34a8d561
Merge pull request #22 from take-cheeze/fix_arg
...
Fix type of argument passed to mrb_get_args.
2014-07-22 15:30:57 +09:00
take_cheeze
689541d0fb
Fix type of argument passed to mrb_get_args.
2014-07-19 21:37:13 +09:00
Tomoyuki Sahara
093f4e2cff
mrb_voidp (and other macros) has gone.
2014-07-09 12:24:50 +09:00
Tomoyuki Sahara
fa39825b1b
refactor.
2014-07-09 10:01:33 +09:00
Tomoyuki Sahara
66a92240de
Merge pull request #21 from dreamedge/add_close_on_exec
...
Add close on exec
2014-07-09 09:34:12 +09:00
dreamedge
78f5f98710
delete debug messages
2014-07-09 05:29:20 +09:00
dreamedge
7e689e8680
Add IO#close_on_exec=
...
and a test on test/io.rb
2014-07-08 15:56:56 +09:00
dreamedge
59b7c4eaf0
add IO.close_on_exec?
2014-07-07 12:47:53 +09:00
Tomoyuki Sahara
91c285fcfe
regen.
2014-07-02 09:12:27 +09:00
Tomoyuki Sahara
04097348e8
more TCP options (for NetBSD).
2014-07-02 09:12:04 +09:00
Tomoyuki Sahara
baa40ef2b1
sort.
2014-07-02 09:09:58 +09:00
Tomoyuki Sahara
9c3c267bef
Merge pull request #14 from dreamedge/add_tcp_constants
...
Add TCP_* constants included in "netinet/tcp.h".
2014-07-02 09:08:47 +09:00
dreamedge
f3c71cf5da
Add TCP_* constants included in "netinet/tcp.h".
...
ex: TCP_NODELAY, TCP_CORK, ...
2014-07-02 00:30:10 +09:00
Tomoyuki Sahara
ddfc4eb5ef
IO#read(0) should return "" immediately. fixes iij/mruby-socket#13 .
2014-06-19 09:57:08 +09:00
Tomoyuki Sahara
376af5bac3
re-implement TCPServer.accept. fixes #12 .
2014-06-17 15:41:42 +09:00
Tomoyuki Sahara
5b65ca3ebb
Merge pull request #5 from take-cheeze/float
...
Add full support of float templates.
2014-06-15 19:54:08 +09:00
take_cheeze
7b2611ea28
Update supported template list.
2014-06-14 13:25:00 +09:00
take_cheeze
8f4b7ac15c
Support float/double unpacking.
2014-06-14 13:25:00 +09:00
take_cheeze
514450e891
Use PACK_FLAG_LITTLEENDIAN.
2014-06-14 13:25:00 +09:00
take_cheeze
7dc2b4f59f
Implement g/f/F/G/d/D packing.
2014-06-14 13:24:59 +09:00
take_cheeze
f4f968241b
Add support of little endian float.
2014-06-14 13:24:49 +09:00
Tomoyuki Sahara
a0c4ca2406
Merge pull request #4 from take-cheeze/raise_fix
...
Fix invalid raise format found with mruby-clang-plugin.
2014-06-14 07:51:42 +09:00
take_cheeze
1997420a7f
Fix raise format found with mruby-clang-plugin.
2014-06-13 17:42:43 +09:00
Tomoyuki Sahara
d894de86f4
fd2 is valid if fd2 >= 0. fixes #18 .
2014-06-10 10:22:50 +09:00
Tomoyuki Sahara
cb84ce30e7
no longer used.
2014-06-10 09:54:23 +09:00
Tomoyuki Sahara
9ee9c271d1
Merge pull request #20 from windwiny/patch-1
...
compatible 32 bit windows
2014-05-09 02:33:00 +09:00
windwiny
dc61ef1c65
compatible 32 bit windows
2014-05-07 20:33:12 +08:00
Tomoyuki Sahara
077f39bd38
Merge pull request #19 from schmurfy/solaris_flock
...
raise an error for flock on solaris
2014-04-29 00:45:08 +09:00
Julien Ammous
9a1b25bdd8
raise an error for flock on solaris
2014-04-28 15:40:04 +02:00
Tomoyuki Sahara
5aeb99ad49
fix mrb_raisef usage.
2014-04-21 11:14:40 +09:00
Tomoyuki Sahara
9c00de59ce
IO.for_fd can be written in Ruby.
2014-04-21 10:24:59 +09:00
Tomoyuki Sahara
c46cb1b5eb
more tests.
2014-04-21 10:02:25 +09:00
Tomoyuki Sahara
e5f30f83ce
IO#flush should raise an exception if it is closed.
2014-04-21 10:01:49 +09:00
Tomoyuki Sahara
99c67749ff
remove return statements after mrb_raise().
2014-04-21 09:06:46 +09:00
Tomoyuki Sahara
7d7a549a4f
remove io_open().
2014-04-18 11:32:38 +09:00
Tomoyuki Sahara
36045ea96f
IO#syswrite should raise an error if it's not opened for writing.
2014-04-18 11:20:55 +09:00
Tomoyuki Sahara
1c4f46f324
remove standard header files from io.h.
2014-04-17 16:29:27 +09:00
Tomoyuki Sahara
a11780f4f1
file.c depends on mruby/ext/io.h now.
2014-04-17 16:18:26 +09:00
Tomoyuki Sahara
a3e1e535dc
function declarations should be in a header file.
2014-04-17 16:13:18 +09:00
Tomoyuki Sahara
9f5ff9ddec
remove unused constants.
2014-04-17 16:12:51 +09:00
Tomoyuki Sahara
ba9cb1f757
"struct mrb_io_type" is not used at all.
2014-04-17 16:07:12 +09:00
Tomoyuki Sahara
10be4cbb2c
file.c does not depend on mruby/ext/io.h.
2014-04-17 15:56:11 +09:00
Tomoyuki Sahara
87ce12dfe3
io.write("") -> 0
2014-04-17 15:53:51 +09:00
Tomoyuki Sahara
810e37b1c3
return value of syswrite may be less than length of given string.
2014-04-17 15:45:31 +09:00
Tomoyuki Sahara
d5cf1de1ae
Merge pull request #16 from schmurfy/solaris
...
solaris does not have flock
2014-04-11 06:53:34 +09:00
Tomoyuki Sahara
1d987d2fcd
Merge pull request #9 from schmurfy/solaris
...
OpenSolaris/Illumos defines a "sun" constant...
2014-04-11 05:50:18 +09:00
Julien Ammous
9850e6a9d0
OpenSolaris/Illumos defines a "sun" constant...
2014-04-10 19:32:05 +02:00
Julien Ammous
cd168c6f32
solaris does not have flock
2014-04-10 19:26:55 +02:00
Tomoyuki Sahara
28e00d82fb
suppress compiler warnings.
2014-04-07 13:15:54 +09:00
Tomoyuki Sahara
a6ab2c54f3
Merge pull request #15 from monami-ya-mrb/pr-add-error-check-in-test
...
Don't ignore the return value of symlink().
2014-04-05 11:55:51 +09:00
Masaki Muranaka
706ef1337a
Don't ignore the return value of symlink().
2014-04-05 10:44:47 +09:00
Akira Yumiyama
572b404935
Update .travis.yml
2014-04-04 11:32:42 +09:00
Akira Yumiyama
2bf49c9232
Update .travis.yml
2014-04-04 11:31:45 +09:00
Akira Yumiyama
083cd9ca8c
Update .travis.yml
2014-04-04 11:31:33 +09:00
Akira Yumiyama
355723ebca
Create .travis.yml
2014-04-04 11:27:56 +09:00
Akira Yumiyama
80e01e3659
Create .travis.yml
2014-04-04 11:27:14 +09:00
Akira Yumiyama
1094bbfff8
Create .travis.yml
2014-04-04 11:25:04 +09:00
Akira Yumiyama
eda9d1a8fc
nonexistent test fixes (for travis-ci)
2014-03-26 22:09:10 +09:00
Tomoyuki Sahara
ab9dcc766e
IO.close should be IO._sysclose. closes #13 .
2014-03-26 17:22:57 +09:00
Tomoyuki Sahara
719452b8d2
remove unsed.
2014-03-14 10:47:54 +09:00
Tomoyuki Sahara
14031bdf44
Merge pull request #11 from pbosetti/master
...
Can build on VisualStudio, revised.
2014-03-14 10:41:56 +09:00
Tomoyuki Sahara
279587c138
split.
2014-03-12 09:44:34 +09:00
Tomoyuki Sahara
a8558512ec
mruby-mtest is not required to build (but to test).
2014-03-12 09:41:23 +09:00
Tomoyuki Sahara
e345d4c68f
Merge pull request #7 from monami-ya-mrb/pr-fix-connect-failed
...
Call Socket._connect() in Socket.connect() .
2014-03-11 23:25:29 +09:00
Masaki Muranaka
11b47459e7
Call Socket._connect() in Socket.connect() .
2014-03-11 21:18:05 +09:00
Paolo Bosetti
39bd240116
Fixed bug in File.expand_path() on Windows (forever recursive loop)
2014-03-07 16:47:18 +01:00
Paolo Bosetti
7ff049457f
Added File.foreach method.
...
Improved error management in File.new (Errno can be undefined)
2014-03-04 10:43:46 +01:00
Paolo Bosetti
d9f3fd868a
Merge branch 'master' of https://github.com/iij/mruby-io into test
...
Conflicts:
src/io.c
2014-03-03 13:15:57 +01:00
Tomoyuki Sahara
f7c054bd39
quiet compiler.
2014-02-25 12:28:34 +09:00
Tomoyuki Sahara
e8706d4ee7
remove unused.
2014-02-25 12:23:15 +09:00
Tomoyuki Sahara
b9dff44582
Merge branch 'master' of github.com:iij/mruby-io
2014-02-25 12:20:52 +09:00
Tomoyuki Sahara
56a8c592dd
add IO.read
2014-02-25 12:19:52 +09:00
Tomoyuki Sahara
a90d8b8a73
add Socket.getaddrinfo.
2014-02-24 11:21:49 +09:00
Akira Yumiyama
d28f042118
compatibility support (mruby/mruby, iij/mruby and 1.0.0)
...
- refs https://github.com/mruby/mruby/commit/36e234aa377d50d8ee425c7868e0651cf78e85cf
2014-02-22 20:45:07 +09:00
Tomoyuki Sahara
7fd585bae1
support older version.
2014-02-14 10:36:37 +09:00
Tomoyuki Sahara
daa65c15de
add dummy IO#flush for better compatibility with CRuby.
2014-02-12 16:33:34 +09:00
Tomoyuki Sahara
40c52f58d0
Merge pull request #9 from matsumoto-r/support_mrb_get_module
...
Support mrb_module_get
2014-02-12 10:57:58 +09:00
Paolo Bosetti
ee2859de6e
Updated mrb_include_module call after mruby 1.0.0
2014-02-11 14:54:30 +01:00
Tomoyuki Sahara
b3c6075dc5
IO._bless has gone.
...
https://github.com/iij/mruby-io/commit/b74458a486042f4863fa6362057e25f0997694f5
2014-02-10 09:51:24 +09:00
Tomoyuki Sahara
b74458a486
remove _bless trick. closes #8 .
2014-02-10 09:49:37 +09:00
MATSUMOTO Ryosuke
526608c8a2
Support mrb_module_ge
2014-02-08 17:38:41 +09:00
Tomoyuki Sahara
f10b73efa7
move license terms to the bottom.
2014-02-03 12:35:02 +09:00
Paolo Bosetti
a2af349959
Now the drive letter is returned as leading path element by File#dirname on Windows
2014-01-13 17:29:57 +01:00
Tomoyuki Sahara
b744097511
Merge pull request #6 from schmurfy/testless
...
removed mtest dependency
2014-01-09 16:09:50 -08:00
Paolo Bosetti
a613bce3f2
Merge branch 'master' of https://github.com/iij/mruby-io
2014-01-07 13:51:38 +01:00
Tomoyuki Sahara
8cee36b1b5
Catch Errno::ENFILE too.
...
When system file descriptor table is full, errno is set to
ENFILE instead of EMFILE. They are similar but different.
2013-12-13 15:49:32 +09:00
Paolo Bosetti
23afaf02dc
Made compatible with VisualStudio
2013-12-10 14:34:26 +01:00
Julien Ammous
a26ce35c64
removed mtest dependency
2013-12-04 20:51:27 +01:00
Tomoyuki Sahara
d12f436bdb
mrb_intern API change.
2013-12-03 10:07:29 +09:00
Paolo Bosetti
5a59fd3a5c
Fix for compilation under Win/MinGW
2013-12-02 12:14:04 +01:00
Tomoyuki Sahara
e641e9a380
suppress a compiler warning.
2013-11-20 12:14:54 +09:00
Tomoyuki Sahara
2245818f91
make it more portable.
2013-11-20 12:13:34 +09:00
Tomoyuki Sahara
78d2d909cf
style
2013-11-20 10:26:13 +09:00
Tomoyuki Sahara
87d878292d
Try GC when Too many open files (revert a part of 1e8097a).
2013-11-16 16:04:31 +09:00
Tomoyuki Sahara
e44da8a6cc
test for #6 .
2013-11-16 05:44:04 +09:00
Tomoyuki Sahara
1e8097a4b8
IO.sysopen raises an exception when open(2) fails. closes #6 .
2013-11-16 05:14:07 +09:00
Tomoyuki Sahara
e96cdeb2af
Merge pull request #3 from h2so5/patch-1
...
avoid declaration error on VC++
2013-11-05 18:31:15 -08:00
h2so5
db14b8e7d4
avoid declaration error on VC++
2013-11-06 11:25:33 +09:00
Tomoyuki Sahara
d8e5e7df3f
Merge pull request #3 from murasesyuka/feature/add_dependencies_gem
...
add mruby-socket dependency gems
2013-11-03 00:41:21 -07:00
murase_syuka
78ebe1b427
add mruby-socket dependency gems
2013-11-02 14:30:42 +09:00
Tomoyuki Sahara
823df14ff4
remove unused code and irrelevant comment.
2013-10-15 10:43:48 +09:00
Tomoyuki Sahara
ec443d45db
more IPPROTO_* related to IPv6.
2013-10-10 10:24:02 +09:00
Tomoyuki Sahara
93edd26b3e
fix typo...
2013-10-09 00:35:22 +09:00
Tomoyuki Sahara
005f01f2fc
fix RSTRING_PTR usage.
2013-10-03 12:18:39 +09:00
Tomoyuki Sahara
bf4c226232
Merge pull request #4 from pbosetti/master
...
Truncate the file to zero length on opening when "w" mode is set
2013-10-02 17:08:24 -07:00
Paolo Bosetti
c608c26ab4
Merge branch 'master' of https://github.com/iij/mruby-io
2013-10-02 13:05:12 +02:00
Paolo Bosetti
49494a7367
Truncate file on File.open(file, "w")
2013-10-02 13:01:56 +02:00
Tomoyuki Sahara
8b48e2b4a4
syswrite must write to fd2 if it is properly set.
...
closes #3 .
2013-09-30 11:56:15 +09:00
Tomoyuki Sahara
97899a6922
style
2013-09-30 11:18:22 +09:00
Tomoyuki Sahara
adb3bd6698
don't retry when we cannot fork(2).
...
EAGAIN indicates the system is under heavy load.
Retrying make things worse.
2013-09-30 10:55:09 +09:00
Tomoyuki Sahara
d75d23294d
fix descriptor leakage.
2013-09-30 10:36:29 +09:00
Tomoyuki Sahara
b4f0a68fba
add File#flock.
2013-09-30 10:17:21 +09:00
Tomoyuki Sahara
140da1c6ca
remove duplicated white spaces.
2013-09-26 18:31:02 +09:00
Tomoyuki Sahara
e27fb544df
suppress a warning and fix a possible segv.
2013-09-26 10:59:40 +09:00
Tomoyuki Sahara
e2b0606752
Merge pull request #2 from pbosetti/master
...
Catch up with API changes on mrb_intern() -> mrb_intern_cstr()
2013-09-25 18:21:27 -07:00
Paolo Bosetti
c4e3c46e86
Catch up with API changes on mrb_intern() -> mrb_intern_cstr()
2013-09-25 13:26:49 +02:00
Tomoyuki Sahara
47a610e688
use array parameter on IO.open.
2013-08-30 19:09:36 +09:00
Tomoyuki Sahara
713aa48cf9
STDERR's file descriptor is 2.
...
closes #1
2013-08-30 17:04:40 +09:00
Tomoyuki Sahara
9dc875f246
add cmd (command output expression).
2013-08-23 16:00:08 +09:00
Tomoyuki Sahara
40adffc676
ARGS_XXX -> MRB_ARGS_XXX
2013-08-21 09:29:38 +09:00
Tomoyuki Sahara
0345215465
fix a possible address family mismatch.
2013-08-14 11:51:53 +09:00
Tomoyuki Sahara
a9593e1f57
v4/v6 fallback for TCP.
2013-08-14 09:34:22 +09:00
Tomoyuki Sahara
5e8021bedb
tests for File.socket? and File.symlink?
2013-08-08 14:00:02 +09:00
Tomoyuki Sahara
c49541058c
use lstat(2) to check if it's a symlink
2013-08-08 13:58:47 +09:00
Tomoyuki Sahara
76e1017f48
hints.ai_socktype must be set if servname is not NULL on NetBSD3.
...
Closes #1
2013-07-25 15:04:59 +09:00
Tomoyuki Sahara
a341b8e0ff
more socket options (for multicast).
2013-07-25 11:58:05 +09:00
Tomoyuki Sahara
cf827ab0e7
fix Addrinfo.getaddrinfo("127.0.0.1", nil).
...
Closes #2
2013-07-25 11:54:53 +09:00
Takashi Sogabe
4f3a749da1
Fix incorrect condition for pendig-IO
2013-06-26 15:24:23 +09:00
Tomoyuki Sahara
216e32751e
Socket.gethostname always fails.
2013-06-21 09:14:53 +09:00
Akira Yumiyama
5625e44371
add method: IO#select
2013-06-02 15:25:14 +09:00
Akira Yumiyama
1272df7cb6
fix IO#eof? method (consider the read buffer)
2013-06-02 13:24:34 +09:00
Akito Mochizuki
35defaf1c9
fix mrb_voidp_value function call
2013-05-28 10:15:25 +09:00
Tomoyuki Sahara
f4aa3e7ae7
getaddrinfo("localhost") returns "fe80::1%lo0" on MacOS!
2013-05-21 14:48:42 +09:00
Tomoyuki Sahara
1411d5b974
using mruby-mtest on test/socket.rb.
2013-05-21 14:23:35 +09:00
Tomoyuki Sahara
12144b9ad2
getaddrinfo("localhost") may return 2 or more.
2013-05-21 14:23:07 +09:00
Tomoyuki Sahara
0f2d7e8a99
fix reading wrong variable.
2013-05-21 14:15:15 +09:00
Tomoyuki Sahara
b8912c3508
Linux does not have getpeereid(2).
2013-05-21 14:13:15 +09:00
Tomoyuki Sahara
4bebd4d70f
mrb_sys_fail() is declared in src/error.h
2013-05-21 14:03:10 +09:00
Tomoyuki Sahara
cfe18142cb
test runner.
2013-05-21 13:53:27 +09:00
Tomoyuki Sahara
89147066f8
mruby-socket depends on mruby-io.
2013-05-21 13:48:33 +09:00
Tomoyuki Sahara
bc5feb39a1
short description, example, requirement, todo, license.
2013-05-21 13:40:14 +09:00
Tomoyuki Sahara
e459ecc934
Merge branch 'master' of github.com:iij/mruby-socket
2013-05-21 13:19:32 +09:00
Tomoyuki Sahara
49e53bca5d
Socket library for mruby.
2013-05-21 13:17:34 +09:00
Tomoyuki Sahara
06f1c82f64
Initial commit
2013-05-20 21:15:50 -07:00
Akira Yumiyama
0a21d9ec92
bufix of mrb_file__gethome()
2013-05-12 14:58:12 +09:00
Akira Yumiyama
e277079616
update run_test.rb
2013-05-12 14:50:31 +09:00
Akira Yumiyama
55b6ef43c5
add return value check of fseek
2013-05-12 14:23:48 +09:00
Akira Yumiyama
14e1992ed0
add null check
2013-05-12 14:15:00 +09:00
Akira Yumiyama
d39a05e68e
remove unused variable.
2013-05-12 14:14:48 +09:00
Akira Yumiyama
49cc9c7cfa
Use strncpy instead of strcpy.
2013-05-12 14:01:53 +09:00
Akira Yumiyama
c25d386c41
Use mkstemp instead of mktemp.
2013-05-12 13:15:11 +09:00
Akira Yumiyama
acc8995060
update run_test.rb
2013-05-12 12:54:35 +09:00
Akira Yumiyama
df529a83d6
add $stdin $stdout $stderr STDIN STDOUT STDERR
2013-05-08 20:22:29 +09:00
Akira Yumiyama
7a94d02e8d
add IO#print
2013-05-08 20:22:14 +09:00
Tomoyuki Sahara
38f4086a52
Merge pull request #2 from schmurfy/double
...
added support for E in pack
2013-05-08 01:53:56 -07:00
Julien Ammous
dce09fb7fd
removed unused variables
2013-05-08 10:26:15 +02:00
Julien Ammous
c869bdedc0
added support for E in pack (double)
2013-05-08 10:26:15 +02:00
Tomoyuki Sahara
8c5cb5e782
cannot pack objects other than the first one. closes #1 .
2013-05-08 09:40:24 +09:00
Akira Yumiyama
f89ee88a6c
rename mrb_class_obj_get -> mrb_class_get
2013-05-02 23:52:57 +09:00
Akira Yumiyama
7618ca6bb3
remove unused Makefile
2013-05-02 23:45:47 +09:00
Akira Yumiyama
8bfbca234f
update run_test.rb
2013-05-02 23:44:40 +09:00
Akira Yumiyama
62e1823187
update run_test.rb
2013-05-02 23:36:20 +09:00
Akira Yumiyama
814f3305ca
put MRB_ prefix before ARGS_XXX macros
2013-04-27 10:09:05 +09:00
Akira Yumiyama
d5982b43c5
put MRB_ prefix before ARGS_XXX macros
2013-04-27 09:47:05 +09:00
Akira Yumiyama
da557fbc82
add File.expand_path
2013-04-07 01:55:18 +09:00
Akira Yumiyama
cc40f93ac8
Kernel#open block support
2013-04-02 15:51:36 +09:00
Akira Yumiyama
911003987b
add Kernel#open
2013-04-02 15:32:01 +09:00
Akira Yumiyama
5a425f598b
Update README.md
2013-04-01 10:17:18 +09:00
Akira Yumiyama
b8a23e6be8
update README.md
2013-04-01 09:21:12 +09:00
Akira Yumiyama
e8ca5e5169
initial commit
2013-04-01 09:12:01 +09:00
Tomoyuki Sahara
858d67c154
add "v" and "V".
2013-02-15 10:54:36 +09:00
Tomoyuki Sahara
fc43022c95
support "V" and "v".
2013-02-15 10:52:37 +09:00
Tomoyuki Sahara
abe9ccfe4b
Merge branch 'master' of https://github.com/iij/mruby-pack
2013-02-15 10:46:21 +09:00
Tomoyuki Sahara
88fa5851f4
fix an issue large/negative integer may not be packed/unpacked correctly.
2013-02-15 10:45:30 +09:00
Tomoyuki Sahara
a0c62dd4b8
fix an issue negative integer may not be packed/unpacked correctly.
2013-02-15 10:39:04 +09:00
Akira Yumiyama
53ff8bab17
update README.md
2013-01-30 17:03:42 +09:00
Akira Yumiyama
aadcbb1690
add mrbgem test runner
2013-01-30 15:20:41 +09:00
Akira Yumiyama
0786e37ed6
update mrbgem.rake
2013-01-30 15:20:10 +09:00
Akira Yumiyama
a0161d69a8
typo fix on mrbgem.rake
2013-01-24 10:12:02 +09:00
Akira Yumiyama
f70a45ad3a
update mrbgem.rake
2013-01-24 10:09:15 +09:00
Akira Yumiyama
558f6fc090
update mrbgem.rake
2013-01-24 09:00:55 +09:00
Akira Yumiyama
e734ab3f95
add mrb_mruby_pack_gem_final
2013-01-24 09:00:40 +09:00
Akira Yumiyama
209ad3171d
add mrbgem.rake
2013-01-04 00:04:02 +09:00
Akira Yumiyama
fb79282a5b
add README.md
2012-12-31 13:15:30 +09:00
Akira Yumiyama
e205905d02
mruby-pack
2012-12-31 11:38:22 +09:00