Hiroshi Mimaki
277391e1b2
Set the mruby-1.3.0 release date to 2017-7-4.
2017-07-04 09:15:16 +09:00
Hiroshi Mimaki
ba1cd56ffa
Fixed an unit test to work on Cygwin.
2017-07-03 16:01:01 +09:00
Yukihiro "Matz" Matsumoto
0de7eec628
Fixed disclosure of local variables by eval; ref #3710
...
This patch fixes the latter part of #3710 . We need to change
`struct REnv` to fix the former part of the issue.
2017-06-19 22:00:16 +09:00
Yukihiro "Matz" Matsumoto
4d3027b08e
Increment the version number to 1.3.0.
2017-06-19 16:47:25 +09:00
Yukihiro "Matz" Matsumoto
ea250d5f52
Increment RITE_BINARY_FORMAT_VER.
...
The behavior of `OP_RAISE` has been changed.
2017-06-19 09:23:03 +09:00
Yukihiro "Matz" Matsumoto
667e788159
Use mrb_int instead of int as argument to mrb_hash_new_capa.
2017-06-19 09:21:07 +09:00
Yukihiro "Matz" Matsumoto
b0f918d1bd
Use mrb_int instead of int.
2017-06-17 10:51:23 +09:00
Yukihiro "Matz" Matsumoto
4b55174fc5
Merge pull request #3706 from MasahikoSawada/fix_typo
...
Fix a typo in gc.c.
2017-06-17 08:40:57 +09:00
Yukihiro "Matz" Matsumoto
08c385ff66
Mark the GC arena in final_marking_phase.
...
Arena can be modified during the marking phase.
2017-06-17 08:39:43 +09:00
Yukihiro "Matz" Matsumoto
819ccd3b85
Mark the root context in final_marking_phase.
...
Because the root context cannot be marked from fibers.
2017-06-17 08:39:43 +09:00
Yukihiro "Matz" Matsumoto
8daabe7115
Mark global variables in final_marking_phase; fix #3704
2017-06-17 08:39:43 +09:00
Yukihiro "Matz" Matsumoto
a985847224
Store operands to local variables.
...
Mostly for debugging purpose.
2017-06-17 08:39:43 +09:00
Yukihiro "Matz" Matsumoto
497a0a791e
Correct comments in gc.c
2017-06-17 08:39:43 +09:00
Yukihiro "Matz" Matsumoto
aa8121cf3a
Use mrb_int instead of size_t for array capacity and length.
2017-06-17 08:39:43 +09:00
Masahiko Sawada
4f0900ef6e
Fix a typo in gc.c.
2017-06-17 00:06:16 +09:00
Yukihiro "Matz" Matsumoto
0411cea2df
Use MRB_PRId instead of d for mrb_int decimal specifier; ref #3701
2017-06-16 11:50:38 +09:00
Yukihiro "Matz" Matsumoto
6fdf2b035d
Merge branch 'ksss-string-upto'
2017-06-16 11:48:32 +09:00
Yukihiro "Matz" Matsumoto
e96f254ead
Use mrb_str_new() instead of malloc(); ref #3701
...
Otherwise the function may terminate and cause memory leaks.
2017-06-16 11:46:40 +09:00
Yukihiro "Matz" Matsumoto
473b2bb20d
Should not use sizeof(buf) when buf is char*; #3701
2017-06-16 11:42:51 +09:00
Yukihiro "Matz" Matsumoto
a7770a39aa
Merge branch 'string-upto' of https://github.com/ksss/mruby into ksss-string-upto
2017-06-16 11:35:42 +09:00
Yukihiro "Matz" Matsumoto
d4d99dd6d7
Allow break from a block called by mrb_yield; close #3359
...
This means #3701 is now OK to merge.
2017-06-16 11:34:11 +09:00
Yukihiro "Matz" Matsumoto
9e6a3f6c95
Use MRB_THROW instead of mrb_exc_raise.
2017-06-16 11:22:17 +09:00
Yukihiro "Matz" Matsumoto
6a66ce10b3
Need to unshare env from top callinfo; fix #3685
2017-06-16 08:25:34 +09:00
Yukihiro "Matz" Matsumoto
ebd6636a1e
Call write barriers for stack-modified fibers; fix #3699
2017-06-15 23:20:36 +09:00
Yukihiro "Matz" Matsumoto
d7e09ffa5f
Print the file name along with line number on syntax errors; fix #3698
2017-06-15 15:46:03 +09:00
Yukihiro "Matz" Matsumoto
47bd44fce1
Prevent Fiber#initialize to be called twice; fix #3705
2017-06-15 15:16:56 +09:00
Yukihiro "Matz" Matsumoto
b298e241c8
Protect the last exception object from GC in ecall; fix #3702
2017-06-15 14:57:18 +09:00
Yukihiro "Matz" Matsumoto
357e478e2c
Mark the exception object in the final marking phase; ref #3702
2017-06-15 14:53:49 +09:00
Yukihiro "Matz" Matsumoto
52443c80e2
Save the register value in a local variable for ease of debugging.
2017-06-15 14:52:58 +09:00
Yukihiro "Matz" Matsumoto
988e2ced03
Ensure size of the stack before handling exceptions; fix #3693
2017-06-15 13:37:27 +09:00
Yukihiro "Matz" Matsumoto
af6041f1d0
Ensure size of the stack in OP_CALL.
2017-06-15 13:36:36 +09:00
Yukihiro "Matz" Matsumoto
bb1bfaa2fb
Add helper functions to use gdb reverse-next.
...
On my machine, gdb reverse-next does not work with memcpy and memset.
Add naive implementation of those functions to override.
2017-06-15 13:32:15 +09:00
ksss
4d9ca27ba6
Use malloc instead of dynamic allocation
2017-06-14 18:28:39 +09:00
ksss
432a813905
Fix arena overflow error
2017-06-14 18:12:56 +09:00
ksss
19785f43d1
Reimplement String#upto
2017-06-14 17:30:31 +09:00
Yukihiro "Matz" Matsumoto
b979226871
Clear stack in OP_CALL; fix #3694
2017-06-14 02:49:07 +09:00
Yukihiro "Matz" Matsumoto
7830b841c7
Fixed uninitialized local variable bug; ref #3692
2017-06-14 01:55:05 +09:00
Yukihiro "Matz" Matsumoto
b32ad1307f
The out-of-memory error should not be an instance of RuntimeError.
...
And arena-overflow error as well. They should not be caught by
`rescue` by default.
2017-06-14 01:01:36 +09:00
Yukihiro "Matz" Matsumoto
edb5b3672b
Avoid out-of-bound access of VM stack in OP_SENDB; fix #3692
2017-06-14 00:46:21 +09:00
Yukihiro "Matz" Matsumoto
b9f771dc50
Handles exceptions from code generation phase; fix #3695
2017-06-07 13:29:08 +09:00
Yukihiro "Matz" Matsumoto
fc7096f18a
Limit recursion level of codegen(); fix #3690
2017-06-05 13:18:31 +09:00
Yukihiro "Matz" Matsumoto
788cea2b43
Revert "Simplify rescue stack management; ref #3683 "
...
This reverts commit eb5a606fe2 and
079f310fbc .
The rescue stack works differently from ensure stack, so the change
caused #3686 and #3688 . It might take long to solve the problems,
so that I would revert the changes for now. Fix #3688
2017-06-03 23:32:15 +09:00
Yukihiro "Matz" Matsumoto
c9a4f8a63b
Prohibit changing generational mode during GC disabled; fix #3689
2017-06-03 16:35:20 +09:00
Yukihiro "Matz" Matsumoto
935649b844
Check if a block is a lambda before marking it orphan; ref #3640
2017-06-03 13:48:09 +09:00
Yukihiro "Matz" Matsumoto
c041206ad1
Add checks for break from proc-closure; fix #3640
2017-06-03 12:44:29 +09:00
Yukihiro "Matz" Matsumoto
ab85d3c814
Make break in lambdas work as return according to CRuby behavior.
2017-06-02 14:22:18 +09:00
Yukihiro "Matz" Matsumoto
7f417ade42
Revert "Update NODE_BLOCK check logic in void_expr_error."
...
This reverts commit 31e30686b0 .
2017-06-02 13:31:03 +09:00
Yukihiro "Matz" Matsumoto
a8bf3742c6
Fixed a bug that make a loop in singleton_class clone; fix #3687
2017-06-02 13:25:15 +09:00
Yukihiro "Matz" Matsumoto
31e30686b0
Update NODE_BLOCK check logic in void_expr_error.
2017-06-02 13:01:29 +09:00
Yukihiro "Matz" Matsumoto
563036eaba
Restore test/t/codegen.rb
2017-06-02 12:19:36 +09:00
Yukihiro "Matz" Matsumoto
0f2f021330
Fixed a bug in void_expr_error.
2017-06-02 12:06:40 +09:00
Yukihiro "Matz" Matsumoto
b59d244c0d
Add more precise void expression checks; ref #3686
2017-06-02 11:53:26 +09:00
Yukihiro "Matz" Matsumoto
e0fbf25f90
Remove tests which can not be compiled on CRuby.
2017-06-02 11:51:59 +09:00
Yukihiro "Matz" Matsumoto
079f310fbc
Adjust ridx if mrb_yield terminated by break; fix #3686
...
This issue is related to #3640 .
2017-06-02 11:26:32 +09:00
Yukihiro "Matz" Matsumoto
51e0e690c2
Avoid invoking GC when disabled or iterating; fix #3681
2017-06-01 19:47:33 +09:00
Yukihiro "Matz" Matsumoto
87cc0344cd
Call stack_clear() after stack_extend(); fix #3682
2017-06-01 19:35:15 +09:00
Yukihiro "Matz" Matsumoto
eb5a606fe2
Simplify rescue stack management; ref #3683
2017-06-01 19:18:24 +09:00
Yukihiro "Matz" Matsumoto
7ff90b52d8
Simplify ensure stack management; fix #3683
2017-06-01 19:17:48 +09:00
Yukihiro "Matz" Matsumoto
72b635f7d2
Hide OP_EXEC lambda body from ObjectSpace#each_object; fix #3680
2017-06-01 15:40:07 +09:00
Yukihiro "Matz" Matsumoto
90fb4dd5b3
Print most recent call last as CPython does.
2017-06-01 09:48:04 +09:00
Yukihiro "Matz" Matsumoto
a893877b0d
Check for super using OP_ARGARY; fix #3678
...
It generates a wasted empty array for each `super` call though.
It should be fixed in the future, if possible.
2017-06-01 09:38:42 +09:00
Yukihiro "Matz" Matsumoto
b0f2bc39db
Clear VM stack in OP_EXEC; ref #3678
2017-06-01 08:45:56 +09:00
Yukihiro "Matz" Matsumoto
eb69eebfd7
Simplify code since OP_EXEC never takes CFUNC Proc; #3678
2017-06-01 08:28:38 +09:00
Yukihiro "Matz" Matsumoto
ff7df939ba
Restore MRB_API function mrb_exc_backtrace(mrb, exc); ref 9644ad5
2017-05-31 23:15:17 +09:00
Yukihiro "Matz" Matsumoto
2837de95fe
Prevent splicing big recursive arrrays; ref #3679
...
We know this is not perfect, but this change makes hack like #3679
bit harder. Harmless for useful cases.
2017-05-31 23:03:39 +09:00
Yukihiro "Matz" Matsumoto
b4a4e3c09a
Simplify the logic in mrb_realloc; ref #3679
2017-05-31 23:02:59 +09:00
Yukihiro "Matz" Matsumoto
7dbbd77407
Revert 4566c80; fix #3679
...
The patch deallocate the memory in `mrb_default_allocf` but that
hinders GC in `mrb_realloc`.
2017-05-31 23:01:04 +09:00
Yukihiro "Matz" Matsumoto
877f9d02e6
Avoid infinite loop on negative exponent; fix #3677
2017-05-31 09:53:19 +09:00
Yukihiro "Matz" Matsumoto
acd3ac62a8
Reduce the size of VM stack clear window; ref #3676
2017-05-31 06:39:12 +09:00
Yukihiro "Matz" Matsumoto
2599c1932e
Clear VM stack for top level; fix #3676
...
Top-level local variables contained junk after ab25eaea2
2017-05-31 00:18:32 +09:00
Yukihiro "Matz" Matsumoto
ef1158485b
Check env context before jump from OP_RETURN; fix #3673
2017-05-30 15:42:10 +09:00
Yukihiro "Matz" Matsumoto
27a5e10454
Avoid using C++ style comments (//).
2017-05-30 11:47:59 +09:00
Yukihiro "Matz" Matsumoto
4b15d5d1e3
Initialize String before Exception; fix #3672
...
The old order generated some strings with their class set to NULL.
2017-05-30 11:38:54 +09:00
Yukihiro "Matz" Matsumoto
650cfb9e4c
Exceptions in fibers must be re-raised via #resume; fix #3675
2017-05-30 11:06:00 +09:00
Yukihiro "Matz" Matsumoto
cbd4aae41c
Mark the proc object representing top-level as an internal object; #3621
2017-05-29 14:13:17 +09:00
Yukihiro "Matz" Matsumoto
abed375ea6
Mark proc objects representing methods as internal objects; fix #3621
2017-05-29 14:12:23 +09:00
Yukihiro "Matz" Matsumoto
02670ffa8d
Protect the returning value in OP_RETURN; fix #3669
...
Even though the returning value is retrieved from the stack,
it may be freed if GC is caused during stack rewinding
(e.g. ensure calls).
2017-05-29 10:33:43 +09:00
Yukihiro "Matz" Matsumoto
9f634a6f8b
Mark the current context (not root) in final marking.
2017-05-29 10:32:42 +09:00
Yukihiro "Matz" Matsumoto
8e390cccae
Fixed rounding functions (round,ceil,floor,truncate) in MRB_INT64.
...
They didn't work well with inexact numbers (inf,nan). Fix #3671
2017-05-27 23:51:22 +09:00
Yukihiro "Matz" Matsumoto
34dd258c63
Unwind callinfo (mrb->c->ci) when a fiber termitates with error.
...
Fix #3668
2017-05-27 18:42:08 +09:00
Yukihiro "Matz" Matsumoto
57ffa1c150
Avoid unsharing env when context (mrb->c) differs; ref #3668
2017-05-27 18:40:15 +09:00
Yukihiro "Matz" Matsumoto
54b45f6a1b
Use RData instead of String to represent backtrace.
2017-05-26 22:30:27 +09:00
Yukihiro "Matz" Matsumoto
f269d1eb40
Distinguish OP_R_NORMAL and OP_R_RETURN.
2017-05-26 11:23:27 +09:00
Yukihiro "Matz" Matsumoto
e3438f404a
Invoke ensure clauses on Fiber termination; fix #3666
...
Related to #3662
2017-05-26 10:50:51 +09:00
Yukihiro "Matz" Matsumoto
83fc915213
Add new range check macro FIXABLE_FLOAT(); ref #3652
...
When MRB_INT64, valid value range of mrb_int is bigger than double,
which only has 53 bits significant precision.
2017-05-26 09:54:10 +09:00
Yukihiro "Matz" Matsumoto
3c31278236
Fix indentation in mrb_init_numeric()
2017-05-26 09:31:45 +09:00
Yukihiro "Matz" Matsumoto
535f13f3d7
fixup! Let Fixnum#{ceil,floor,round,truncate} to return itself; #3652
2017-05-26 09:29:39 +09:00
Yukihiro "Matz" Matsumoto
c80696fcd3
Let Fixnum#{ceil,floor,round,truncate} to return itself; #3652
2017-05-26 09:25:16 +09:00
Yukihiro "Matz" Matsumoto
06c4933f90
Try our own ipow() if both base and exp are fixnums; fix #3652
2017-05-26 02:19:07 +09:00
Yukihiro "Matz" Matsumoto
9e40586d43
Add cast to mrb_int in mrb_fixnum() when MRB_WORD_BOXING.
...
Without this cast, `long int:63` can cause warnings.
2017-05-26 02:16:18 +09:00
Yukihiro "Matz" Matsumoto
7e4731655f
Fixed off-by-one error in fiber_switch(); ref #3641
2017-05-26 01:24:28 +09:00
Yukihiro "Matz" Matsumoto
f75f506181
Revert 01f7825; fix #3650
...
Redundant `mark_context() is far better than crashes.
2017-05-25 21:58:15 +09:00
Yukihiro "Matz" Matsumoto
ac442bc1df
Raise an exception when transfer arguments are too many; fix #3641
...
The fix was proposed by @block8437. Thank you.
2017-05-25 21:39:13 +09:00
Yukihiro "Matz" Matsumoto
de48d95c6d
Avoid marking possibly freed stack; #3550 #3612
2017-05-25 19:58:06 +09:00
Yukihiro "Matz" Matsumoto
c53747dbdf
Revert "Use env preserved in Proc structure in ecall(); fix #3612 "
...
This reverts commit e26e118604 .
Fix #3664
2017-05-25 19:57:46 +09:00
Yukihiro "Matz" Matsumoto
517cd51cea
Invoke ensure clauses before switching context from fibers; fix #3662
2017-05-25 14:36:25 +09:00
Yukihiro "Matz" Matsumoto
ed16535c73
Clear top level env in mrb_top_run(); fix #3643
2017-05-25 14:13:54 +09:00
Yukihiro "Matz" Matsumoto
f88cb88073
Avoid unsharing stack if env refers top-level; ref #3643
2017-05-25 14:13:16 +09:00
Yukihiro "Matz" Matsumoto
e0931126ff
Check env stack length before OP_SETUPVAR; ref #3643
2017-05-25 14:12:16 +09:00
Yukihiro "Matz" Matsumoto
e969229b77
Check backtrace info may not be set (esp. NoMemError); fix #3663
2017-05-25 12:56:19 +09:00
Yukihiro "Matz" Matsumoto
5e1a6a2cc2
Make gen_assignment() to support NODE_SCALL; ref #3658
2017-05-25 12:40:49 +09:00
Yukihiro "Matz" Matsumoto
4566c80d7b
Free given pointer if realloc() fails; fix #3658
2017-05-25 12:36:38 +09:00
Yukihiro "Matz" Matsumoto
ff46957ef0
Avoid using mrb_raise() in mrb_vm_exec(); ref #3660
2017-05-25 11:11:40 +09:00
Yukihiro "Matz" Matsumoto
3ef97e3dd9
Under MRB_INT64, width may be bigger than INT_MAX; fix #3665
2017-05-25 10:40:35 +09:00
Yukihiro "Matz" Matsumoto
9bca887ac4
Preserve the current pc before method_missing(); fix #3660
2017-05-25 10:31:48 +09:00
Yukihiro "Matz" Matsumoto
9644ad51b4
Simplify backtrace mechanism; fix #3633 #3634 #3644
...
Instead of preserving a backtrace in `mrb_state`, `mrb_exc_set`
keeps packed backtrace in an exception object. `#backtrace` unpacks
it to an array of strings.
2017-05-23 23:50:42 +09:00
Yukihiro "Matz" Matsumoto
d2458e66c2
Remove class info from backtrace lines.
2017-05-23 23:50:42 +09:00
Yukihiro "Matz" Matsumoto
497b19ce22
Support the case when the backtrace is not an array.
2017-05-23 23:50:42 +09:00
Yukihiro "Matz" Matsumoto
a1ea2a670c
Use index in each_object.
2017-05-23 23:50:42 +09:00
Yukihiro "Matz" Matsumoto
24a24a41dd
Type check before print_backtrace()
2017-05-23 23:50:42 +09:00
Yukihiro "Matz" Matsumoto
bb0b52a568
Update comments regarding Exception#to_str
2017-05-23 23:50:42 +09:00
Yukihiro "Matz" Matsumoto
1bb6964db6
Merge pull request #3661 from ksss/string-concat
...
String#concat: Try to convert when not string
2017-05-21 22:53:01 +09:00
ksss
98f9c33fe0
String#concat: Try to convert when not string
2017-05-21 10:30:27 +09:00
Yukihiro "Matz" Matsumoto
78add72812
Merge pull request #3659 from craiglrock/master
...
Avoid call to_s during backtrace traversal
2017-05-16 10:04:19 +09:00
Craig Lehmann
3de2da409b
Avoid call to_s during backtrace traversal
2017-05-15 20:40:47 -04:00
Yukihiro "Matz" Matsumoto
82bc036a59
Merge pull request #3657 from ksss/str-embed
...
Make string embad from shared
2017-05-14 00:28:32 +09:00
ksss
bdb36b3404
Make string embad from shared
2017-05-13 22:44:52 +09:00
Yukihiro "Matz" Matsumoto
171e732dc7
Merge pull request #3656 from clayton-shopify/fix-codegen-default
...
Change return back to break in the default case.
2017-05-13 09:37:34 +09:00
Clayton Smith
bf30b8e8bf
Change return back to break in the default case.
2017-05-12 14:43:12 -04:00
Yukihiro "Matz" Matsumoto
011e0bb0d9
Merge pull request #3649 from ksss/sprintf
...
Fix segmentation fault ref: #3648
2017-05-09 07:40:08 +09:00
ksss
30df7c8762
Fix segmentation fault ref: #3648
2017-05-08 23:18:14 +09:00
Yukihiro "Matz" Matsumoto
ef305305b4
Merge pull request #3647 from ksss/split
...
Adjust to the optimum type
2017-05-05 21:34:59 +09:00
ksss
8cba9a9e42
Adjust to the optimum type
2017-05-05 14:20:21 +09:00
Yukihiro "Matz" Matsumoto
964a02f1fa
Merge pull request #3645 from nobu/sprintf-refactor
...
Sprintf refactor
2017-04-29 13:10:34 +09:00
Nobuyoshi Nakada
ef6e14ee2b
Better error message
...
Raise argument error with the better message, at the only place
where the size to fill can be negative.
2017-04-29 10:17:24 +09:00
Nobuyoshi Nakada
e05c30738e
Use FILL and PUSH
...
Instead of loop or `memcpy` after `CHECK`, use dedicated macros,
`FILL` and `PUSH`, respectively.
2017-04-29 10:10:31 +09:00
Yukihiro "Matz" Matsumoto
3c10783769
Merge pull request #3639 from Asmod4n/patch-1
...
Add macOS support to mrb_ro_data_p
2017-04-26 07:49:14 +09:00
Asmod4n
9057a3f3be
Add macOS support to mrb_ro_data_p
...
This adds macOS support to mrb_ro_data_p, fixes #3636
2017-04-25 20:34:07 +02:00
Yukihiro "Matz" Matsumoto
cef523cc19
Avoid duplicated envadjust() of env stacks; fix #3637
2017-04-25 22:31:02 +09:00
Yukihiro "Matz" Matsumoto
a3d80e8e73
Merge pull request #3637 from dabroz/fix-32-bit
...
Restore 32-bit OSX builds
2017-04-25 22:03:50 +09:00
Yukihiro "Matz" Matsumoto
3e07a2d77c
Silence warnings caused by implicit type casting.
2017-04-25 21:00:16 +09:00
Yukihiro "Matz" Matsumoto
92dcfbaab3
Add explicit cast from double to long.
2017-04-25 17:43:03 +09:00
Yukihiro "Matz" Matsumoto
b08dced2a6
Stop invoking GC before each_object to avoid test failure; #3616
2017-04-25 17:39:06 +09:00
Yukihiro "Matz" Matsumoto
aa8e490fd5
Prevent GC during each_object; fix #3616
2017-04-25 17:25:48 +09:00
Yukihiro "Matz" Matsumoto
88cd807379
Avoid use of snprintf() when DISABLE_STDIO is set; fix #3632
...
ref #3492 #3515 #3517
2017-04-25 10:41:50 +09:00
Yukihiro "Matz" Matsumoto
03cdb8e9dd
Should terminate nested iterations in each_object; ref #3359
2017-04-25 10:41:50 +09:00
Yukihiro "Matz" Matsumoto
058da1fed2
Revert "Disable GC during gc_each_objects(); fix #3616 "
...
This reverts commit d2cad9ac5b .
2017-04-25 10:41:50 +09:00
Yukihiro "Matz" Matsumoto
01f7825852
Use fiber marking instead of mark_context.
...
To avoid redundant `mark_context()`.
2017-04-25 10:41:50 +09:00
Tomasz Dąbrowski
b1120464e0
Revert "Simplify pointer calculation in envadjust."
...
This reverts commit a1d32af916 .
2017-04-24 23:57:39 +02:00
Yukihiro "Matz" Matsumoto
6088276cc8
Merge pull request #3630 from nobu/bug/sprintf-sp3inf
...
Fix space flag with inf/nan
2017-04-24 09:06:57 +09:00
Yukihiro "Matz" Matsumoto
72bdb6a93f
Merge pull request #3631 from nobu/bug/embeddoc-terminator-word
...
Fix embedded document with unterminated terminator
2017-04-24 09:06:12 +09:00
Nobuyoshi Nakada
d54f9f8f78
Fix embedded document with unterminated terminator
...
`skips()` is `mrb_bool` function, should return `FALSE` at EOF, not
`EOF`.
2017-04-23 11:41:00 +09:00
Nobuyoshi Nakada
cd4e9a0518
Refactor "%f" % Inf/NaN
...
As for non-finite float, calculate the exact needed size with the
space flag.
2017-04-23 09:54:44 +09:00
Nobuyoshi Nakada
7314423bd1
Fix space flag when Inf/NaN and width==3
...
While `"% 2f"` and `"% 4f"` result in `" Inf"` and `" Inf"`
respectively, `"% 3f"` results in `"Inf"` (no space).
2017-04-23 09:54:20 +09:00
Yukihiro "Matz" Matsumoto
809b7ca3f4
Merge pull request #3628 from yyamano/libmruby-path
...
Add --libmruby-path support to mruby-bin-mruby-config.
2017-04-22 15:16:57 +09:00
Yukihiro "Matz" Matsumoto
a4dfaaf1e8
Small cosmetic changes.
2017-04-22 15:09:41 +09:00
Yukihiro "Matz" Matsumoto
e26e118604
Use env preserved in Proc structure in ecall(); fix #3612
2017-04-22 15:08:18 +09:00
Yukihiro "Matz" Matsumoto
5513fcee22
Keep reference to mrb_context from env; fix #3619
2017-04-22 14:35:36 +09:00
Yuji Yamano
52a03800d3
Add --libmruby-path support to mruby-bin-mruby-config.
2017-04-22 14:09:06 +09:00
Yukihiro "Matz" Matsumoto
3b0a36d399
Alias should push() extra stack space for blocks.
2017-04-22 12:03:56 +09:00
Yukihiro "Matz" Matsumoto
a1d32af916
Simplify pointer calculation in envadjust.
2017-04-21 22:29:28 +09:00
Yukihiro "Matz" Matsumoto
ad3b61f47b
Revert e8dca6b03; fix #3550
...
Reopens #3612 .
2017-04-21 22:29:28 +09:00
Yukihiro "Matz" Matsumoto
5d67d9b10d
Fixed a possible memory leak.
2017-04-21 22:29:28 +09:00
Yukihiro "Matz" Matsumoto
15fba69710
Revert ae4217e81; fix #3619
...
Reopens #3550 . Those 2 issues are exclusive.
2017-04-21 22:29:28 +09:00
Yukihiro "Matz" Matsumoto
95229ee164
Assign to local variable first; cosmetic change.
2017-04-21 22:29:28 +09:00
Yukihiro "Matz" Matsumoto
c900fff9a1
Merge pull request #3623 from take-cheeze/struct_freeze
...
Support `freeze` method in `Struct`.
2017-04-21 22:28:32 +09:00
Yukihiro "Matz" Matsumoto
c73da29aee
Merge pull request #3624 from yyamano/fix-typo
...
Fix typo in usage message.
2017-04-21 22:27:52 +09:00
Yukihiro "Matz" Matsumoto
00770e2d3d
Merge pull request #3625 from take-cheeze/pool_64bit
...
Align pool allocator with 8 byte in 64-bit environment.
2017-04-21 22:27:33 +09:00
Yukihiro "Matz" Matsumoto
02df2539df
Merge pull request #3626 from take-cheeze/string_get_args_bug
...
Add missing `arg_i++` to fix bug of `s!` in mrb_get_args.
2017-04-21 22:27:07 +09:00
take_cheeze
3ce42a04e3
Add missing arg_i++ to fix bug of s! in mrb_get_args.
2017-04-21 17:52:29 +09:00
take_cheeze
b2dc04393a
Align pool allocator with 8 byte in 64-bit environment.
...
To avoid warnings from undefined sanitizer.
( https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html )
2017-04-21 17:34:31 +09:00
Yuji Yamano
33d09e4ad0
Fix typo in usage message.
2017-04-21 04:32:41 -04:00
take_cheeze
da5b7fa769
Support freeze in Struct.
2017-04-21 17:23:54 +09:00
Yukihiro "Matz" Matsumoto
94bcdca64f
VM stack may be reallocated in mrb_convert_type(); fix #3622
2017-04-21 09:11:28 +09:00
Yukihiro "Matz" Matsumoto
262fbaf566
mrb_int may overflow in bit-shifting; fix #3620
2017-04-21 08:55:19 +09:00
Yukihiro "Matz" Matsumoto
3567b26222
Bit-shifting zero should be zero; ref #3620
2017-04-21 08:36:29 +09:00
Yukihiro "Matz" Matsumoto
d2cad9ac5b
Disable GC during gc_each_objects(); fix #3616
2017-04-20 15:50:52 +09:00
Yukihiro "Matz" Matsumoto
62dae09bf6
Allow mrb_objspace_each_objects() to break iteration; ref #3359
2017-04-20 15:44:56 +09:00
Yukihiro "Matz" Matsumoto
edd9fc6e75
Do not raise an exception for living closure; ref #3359
2017-04-20 13:14:01 +09:00
Yukihiro "Matz" Matsumoto
6a0b68f8b8
Use trampoline technique for instance_exec; ref #3359
...
A new function `mrb_yield_cont()` is provided. You have to call it
at the end of a C defined method, e.g. `return mrb_yield_cont()`.
2017-04-19 19:54:55 +09:00
Yukihiro "Matz" Matsumoto
77c2aa7b8a
Need to raise "break from proc-closure" error; fix #3359 fix #3495
...
Some examples in #3359 still behave differently from CRuby.
2017-04-19 19:38:57 +09:00
Yukihiro "Matz" Matsumoto
283d145d3e
Fixed a bug caused by last minute change; fix #3610
...
Omitted `goto L_RAISE` to raise an exception.
2017-04-19 09:28:58 +09:00
Yukihiro "Matz" Matsumoto
fe3fe8fccc
Merge pull request #3615 from clayton-shopify/fix-copy-class-null-pointer-deref
...
Check if sc->mt is initialized before copying it.
2017-04-19 07:07:03 +09:00
Clayton Smith
de96994233
Check if sc->mt is initialized before copying it.
2017-04-18 11:18:58 -04:00
Yukihiro "Matz" Matsumoto
79e0314337
Call envadjust() before updating VM stack.
2017-04-18 16:49:43 +09:00
Yukihiro "Matz" Matsumoto
ae4217e813
Fixed a wrong condition; fix #3550
...
Shared TT_ENV should be unshared. Reversed condition.
2017-04-18 16:49:14 +09:00
Yukihiro "Matz" Matsumoto
e8dca6b034
Revert 6dd1a57; fix #3612 ; ref #3550
...
The fix was wrong. It causes a new problem #3612 .
2017-04-18 16:48:50 +09:00
Yukihiro "Matz" Matsumoto
a0143e148d
Make mrb_codedump_all() to print type of Proc.
2017-04-18 12:40:36 +09:00
Yukihiro "Matz" Matsumoto
f4119f518f
Changed evaluation order of yield; ref #3613
...
So that `yield expr_with_error` will cause the error from the
argument rather than `LocalJumpError` when no block is given.
2017-04-18 12:00:52 +09:00
Yukihiro "Matz" Matsumoto
f6c70bc6e8
super may call context switching method like send; fix #3611
2017-04-18 11:52:16 +09:00
Yukihiro "Matz" Matsumoto
05fceb5992
Call exc_debug_info() in mrb_exc_set(); ref #3610
...
Otherwise line number information is lacked from exceptions
raised in VM, e.g. "super called outside of method".
2017-04-18 10:28:49 +09:00
Yukihiro "Matz" Matsumoto
82ab46139e
Add "no super" check to OP_ARGARY; fix #3610
2017-04-18 10:28:49 +09:00
Yukihiro "Matz" Matsumoto
c3961847cf
Hash#dup didn't check if internal khash is initialized; fix #3609
2017-04-18 09:55:32 +09:00
Yukihiro "Matz" Matsumoto
761493934e
Mark whole root objects in final_marking_phase(); fix #3603
...
ref #1359 #1362
2017-04-17 16:06:18 +09:00
Yukihiro "Matz" Matsumoto
323121925a
Merge pull request #3608 from clayton-shopify/fix-mirb-off-by-one
...
Fix an off-by-one causing a buffer overflow in mirb.
2017-04-14 07:07:52 +09:00
Clayton Smith
8e2279d1ff
Fix an off-by-one causing a buffer overflow in mirb.
2017-04-13 10:51:26 -04:00
Yukihiro "Matz" Matsumoto
045e78c844
Proc#call needs to reserve at least 2 registers; fix #3606
...
One for the receiver, the other for the block.
2017-04-13 11:02:02 +09:00
Yukihiro "Matz" Matsumoto
17377af984
Struct may not be initialized in #to_h; fix #3607
2017-04-13 10:51:16 +09:00
Yukihiro "Matz" Matsumoto
aec121f755
Update NODE_XSTR, NODE_DSXTR tests; ref #3605
2017-04-13 07:54:51 +09:00
Yukihiro "Matz" Matsumoto
c0a4b1a0c6
Merge pull request #3604 from keizo042/fix_issue3598
...
Find Class/Module in nested singleton class; fix #3598
2017-04-13 00:42:26 +09:00
Yukihiro "Matz" Matsumoto
3123549bcb
Fixed a bug in NODE_XSTR code generation; fix #3605
2017-04-13 00:38:47 +09:00
Kouichi Nakanishi
d4205c9b20
Use while statement instead of for statement
2017-04-12 23:27:09 +09:00
Kouichi Nakanishi
4fca570a74
Find Class/Module in nested singleton class; fix #3598
2017-04-12 22:41:36 +09:00
Yukihiro "Matz" Matsumoto
4e84bdb507
Let 'mrb_vm_run()` to restore the calling fiber; ref #3537
2017-04-12 11:01:23 +09:00
Yukihiro "Matz" Matsumoto
0fb05eb55f
Should not unshare env stack repeatedly; fix #3601
2017-04-12 10:41:06 +09:00
Yukihiro "Matz" Matsumoto
2a4db1a4be
method_missing might have updated stack beyond boundary; fix #3599
2017-04-12 10:28:57 +09:00
Yukihiro "Matz" Matsumoto
326e043a64
Exceptions may be raised in yyparse(); fix #3600
2017-04-12 10:23:34 +09:00
Yukihiro "Matz" Matsumoto
918e7bb187
Refactor check before mrb_class_ptr(); ref #3602
2017-04-12 09:20:57 +09:00
Yukihiro "Matz" Matsumoto
a25404c305
The attached object may not be a class; fix #3602
2017-04-12 09:18:44 +09:00
Yukihiro "Matz" Matsumoto
6dd1a570c2
Shared TT_ENV may need to be marked; fix #3550
2017-04-11 12:40:26 +09:00
Yukihiro "Matz" Matsumoto
fff4a4ed34
OP_LAMBDA generation should honor VAL/NOVAL; fix #3580
2017-04-11 02:30:24 +09:00
Yukihiro "Matz" Matsumoto
db47ae5de5
Fixed a bug in mrb_convert_to_integer(); fix #3581
...
Did not update the result from `mrb_check_string_type()` before
string-to-integer conversion.
2017-04-11 02:00:02 +09:00
Yukihiro "Matz" Matsumoto
03c849338f
Fiber#yield should check C function boundary; fix #3582
2017-04-11 01:51:25 +09:00
Yukihiro "Matz" Matsumoto
9094415acf
An object attached to a singleton class may not be a class; fix #3587
...
The fix for #3539 was incomplete.
2017-04-10 22:02:51 +09:00
Yukihiro "Matz" Matsumoto
0048dd118a
Protect arguments from GC; fix #3597
...
GC may be called with OP_ENTER (especially when GC_STRESS is set).
2017-04-10 21:12:41 +09:00
Yukihiro "Matz" Matsumoto
a55b237d89
Callinfo may be changed in ecall(); fix #3589
2017-04-10 20:39:49 +09:00
Yukihiro "Matz" Matsumoto
ab25eaea23
Avoid clearing VM stack every time to gain performance.
...
VM stack is cleared by 5c114c9 , 0cb501 and c063641 .
2017-04-10 09:59:36 +09:00
Yukihiro "Matz" Matsumoto
5c114c91d4
Clear unused stack region that may refer freed objects; fix #3596
2017-04-10 09:46:09 +09:00
Yukihiro "Matz" Matsumoto
491d68bb30
Skip stack marking at all if c->stack is NULL.
2017-04-10 09:28:36 +09:00
Yukihiro "Matz" Matsumoto
0cb501545c
Fill omitted arguments by nil for non-strict Proc.
2017-04-10 09:24:42 +09:00
Yukihiro "Matz" Matsumoto
c063641ab0
Clear local (but non-argument) variables in OP_ENTER.
...
Otherwise, the following script prints an uninitialized value.
def f(*a)
if false
b = 15
end
p b
end
f(1,2,3)
2017-04-10 08:25:44 +09:00
Yukihiro "Matz" Matsumoto
47f181519f
Avoid updating regs[] from function calls; ref #3588
2017-04-08 17:47:35 +09:00
Yukihiro "Matz" Matsumoto
1fd3cc9e1d
Merge pull request #3595 from keizo042/name_stack_size
...
Attach a name to embbeded value of rescue/ensure stack size
2017-04-08 17:47:20 +09:00
Kouichi Nakanishi
15b55c32e9
Attach a name to embbeded value of rescue/ensure stack size
2017-04-08 11:22:41 +09:00
Yukihiro "Matz" Matsumoto
7e28510725
Merge pull request #3594 from keizo042/fix_isssue_3575
...
Get constant of parent class even if child class is defined in signle…
2017-04-07 11:39:11 +09:00
Kouichi Nakanishi
fd0f79ca67
Get constant of parent class even if child class is defined in signleton class; fix #3575
2017-04-06 23:31:34 +09:00
Yukihiro "Matz" Matsumoto
e5b61d34f6
Fixed possible SEGV in Kernel#block_given?; ref #3593
2017-04-06 10:07:53 +09:00
Yukihiro "Matz" Matsumoto
5e79bc9377
Make String#replace to check equality before modifying flags.
...
ref #3588
2017-04-06 08:25:25 +09:00
Yukihiro "Matz" Matsumoto
a7b0ab3769
Save block argument position in e->cioff; fix #3593
2017-04-05 22:30:39 +09:00
Yukihiro "Matz" Matsumoto
d9fb8b69b0
Fixed a bug in OP_SUPER block conversion; fix #3590
2017-04-05 18:22:26 +09:00
Yukihiro "Matz" Matsumoto
bd7bf260e8
Should specify instance type of Structs; fix #3591
2017-04-05 17:52:26 +09:00
Yukihiro "Matz" Matsumoto
2daebfb6a7
Fixed a bug when method_missing take 126 args; fix #3592
2017-04-05 14:41:34 +09:00
Yukihiro "Matz" Matsumoto
60d20e1848
Should restore to the root fiber for each interaction; fix #3537
2017-04-05 13:53:43 +09:00
Yukihiro "Matz" Matsumoto
7f37c2fc57
Use stderr for debug prints in DEBUG(); fix #3584
2017-04-05 12:38:38 +09:00
Yukihiro "Matz" Matsumoto
74712c73ac
Need to insert write barriers in struct updates; fix #3547
2017-04-05 11:53:20 +09:00
Yukihiro "Matz" Matsumoto
bdeb803f04
Merge pull request #3579 from clayton-shopify/fix-time-alloc-usec
...
Correctly handle large negative usec value.
2017-04-04 11:17:10 +09:00
Clayton Smith
dc4fba28c5
Correctly handle large negative usec value.
2017-04-03 14:22:26 -04:00
Yukihiro "Matz" Matsumoto
e2e2edae51
Merge pull request #3578 from bggd/appveyor_clone_depth
...
Change AppVeyor's clone_depth
2017-04-03 21:48:24 +09:00
bggd
de114eb38d
Change AppVeyor's clone_depth
2017-04-03 20:16:14 +09:00
Yukihiro "Matz" Matsumoto
12f6496ff8
Revert "Adjust VM stack window size; fix #3547 "
...
This reverts commit 6dabb33635 .
2017-04-03 19:49:42 +09:00
Yukihiro "Matz" Matsumoto
6dabb33635
Adjust VM stack window size; fix #3547
2017-04-03 19:12:13 +09:00
Yukihiro "Matz" Matsumoto
ab63ee61ca
Fixed out-of-bounds access of ensure[]; ref #3491
2017-04-03 18:47:38 +09:00
Yukihiro "Matz" Matsumoto
b8461c8681
Protect ensure clause lambdas from GC; fix #3491
2017-04-03 18:38:49 +09:00
Yukihiro "Matz" Matsumoto
6a992a2579
Merge pull request #3577 from okkez/fix-return-value-of-each-slice
...
Change return value of Enumerable#each_slice
2017-04-03 18:04:57 +09:00
Yukihiro "Matz" Matsumoto
fea8d00ef2
Merge pull request #3576 from okkez/fix-return-value-of-each-cons
...
Change return value of Enumberable#each_cons
2017-04-03 18:04:33 +09:00
Yukihiro "Matz" Matsumoto
0a1f15e57c
Insert mrb_field_write_barrier() for GC; fix #3534
2017-04-03 18:01:43 +09:00
Yukihiro "Matz" Matsumoto
246db71139
Add struct REnv to union RVALUE; ref #3534
2017-04-03 18:01:17 +09:00
Yukihiro "Matz" Matsumoto
77331d127b
Unify else clause style
2017-04-03 16:56:27 +09:00
Yukihiro "Matz" Matsumoto
fbf4089d2f
Remove spaces around parens
2017-04-03 16:49:18 +09:00
Kenji Okimoto
cff54ab2f3
Change return value of Enumerable#each_slice
...
More compatibility to CRuby.
2017-04-03 16:46:47 +09:00
Kenji Okimoto
4975aa4c1c
Change return value of Enumberable#each_cons
...
More compatibility to CRuby.
2017-04-03 16:42:53 +09:00
Yukihiro "Matz" Matsumoto
666787beb2
Adjust exit point in loop_pop(); fix #3541
2017-04-03 12:41:27 +09:00
Yukihiro "Matz" Matsumoto
d35fcf1ea2
NODE_SPLAT to pass VAL/NOVAL; fix #3532
2017-04-03 12:02:39 +09:00
Yukihiro "Matz" Matsumoto
f5632f2f12
Restrict recursion levels in method_missing(); fix #3556
...
Note this is a temporary fix. Error message generation
(including `inspect`) should be deferred until its use.
2017-04-03 10:50:31 +09:00
Yukihiro "Matz" Matsumoto
d27a3d47cd
String#initialize to make a string empty; ref #3574
2017-04-03 10:22:38 +09:00
Yukihiro "Matz" Matsumoto
a14a930c80
Remove unnecessary indirection; ref #3557
2017-04-03 10:03:58 +09:00
Yukihiro "Matz" Matsumoto
8193c0b566
Check before generating special operators (e.g. OP_ADD); fix #3557
2017-04-03 10:01:44 +09:00
Yukihiro "Matz" Matsumoto
a49c9f86e7
Update callinfo->target_class in mrb_exec_irep(); fix #3543
2017-04-03 00:05:16 +09:00
Yukihiro "Matz" Matsumoto
081535bf02
Merge pull request #3573 from ksss/parameters
...
Fix parameters when noname rest
2017-04-02 23:54:30 +09:00
ksss
7f983928b9
Reduce object allocation
2017-04-02 23:34:26 +09:00
ksss
be5c304b4c
Fix parameters when noname rest
2017-04-02 23:30:05 +09:00
Yukihiro "Matz" Matsumoto
5d00e85314
Fixed out of bounds access; fix #3572 , ref #3553
2017-04-02 20:32:11 +09:00
Yukihiro "Matz" Matsumoto
5a445f012e
Add alias "append" to Array#push, and "prepend" to Array#unshift.
...
According to CRuby [Feature#12746]
2017-04-01 21:27:23 +09:00
Yukihiro "Matz" Matsumoto
93d802987e
Extend VM stack just in case; ref #3551
2017-04-01 21:21:57 +09:00
Yukihiro "Matz" Matsumoto
071164b799
Should not shrink VM stack; fix #3551
2017-04-01 18:54:37 +09:00
Yukihiro "Matz" Matsumoto
56322cd5dd
Pacify signed warning; ref #3565
2017-04-01 18:41:55 +09:00
Yukihiro "Matz" Matsumoto
dcbfe71625
NODE_ASGN arguments may be 127 (CALL_MAXARGS) accidentally; fix #3559
2017-04-01 14:11:15 +09:00
Yukihiro "Matz" Matsumoto
e22f37a166
Argument order of __case_eqq was wrong; fix #3567
2017-04-01 13:42:44 +09:00
Yukihiro "Matz" Matsumoto
1e87dfdf48
The stack may be reallocated in the func call; fix #3560
2017-04-01 13:20:19 +09:00
Yukihiro "Matz" Matsumoto
8d9d7c929e
Improve Time.new() performance using division; fix #3561
2017-04-01 13:03:34 +09:00
Yukihiro "Matz" Matsumoto
195af525fb
Expand stack for method_missing; fix #3528
2017-04-01 12:42:11 +09:00
Yukihiro "Matz" Matsumoto
9eb2ed0879
Merge pull request #3571 from keizo042/fix_get_constant_of_module_from_sigleton
...
Modify to get constant of parent module in singleton class; fix #3568
2017-03-31 16:39:21 +09:00
Kouichi Nakanishi
507e00e86f
Modify to get constant of parent module in singleton class; fix #3568
2017-03-31 13:43:20 +09:00
Yukihiro "Matz" Matsumoto
39ca4ef3bc
Avoid crash if hv.n is greater than kh_size(h); fix #3565
...
The resulting behavior is different from CRuby, but modifying
hash key afterwards is undefined behavior in ISO spec.
2017-03-31 13:02:01 +09:00
Yukihiro "Matz" Matsumoto
952207d243
small cosmetic change; ref #3570
2017-03-30 17:10:44 +09:00
Yukihiro "Matz" Matsumoto
669b18383d
Merge pull request #3570 from keizo042/fix_cv_definition_in_singleton
...
Modify class variable definition in singleton class; fix #3539
2017-03-30 17:09:43 +09:00
Kouichi Nakanishi
5efe77fede
Modify class variable definition in singleton class; fix #3539
2017-03-30 16:29:47 +09:00
Yukihiro "Matz" Matsumoto
898077a2c2
Merge pull request #3566 from okkez/fix-enumerator-each-with-index
...
Fix Enumerator#each_with_index with block
2017-03-30 14:49:34 +09:00
Kenji Okimoto
d93a5c1a84
Fix Enumerator#each_with_index with block
...
In previous version,
```
a = [3, 2, 1]
e = a.each
e.sort_by(&:to_i) # => []
```
In this version,
```
a = [3, 2, 1]
e = a.each
e.sort_by(&:to_i) # => [1, 2, 3]
```
2017-03-30 10:53:55 +09:00
Yukihiro "Matz" Matsumoto
905f46a129
Merge pull request #3558 from ksss/domain
...
Should raise FloatDomainError
2017-03-29 12:50:42 +09:00
ksss
db3573e0bf
Should raise FloatDomainError
2017-03-29 11:59:19 +09:00
Yukihiro "Matz" Matsumoto
1f6bf0e14f
Merge pull request #3563 from clayton-shopify/dup-renumber-keys
...
Renumber hash keys during dup since there may be duplicates.
2017-03-29 09:43:33 +09:00
Yukihiro "Matz" Matsumoto
506c05f01d
Merge pull request #3564 from okkez/set-proper-class-to-subclass-of-array
...
Set proper class to subclass of Array
2017-03-29 09:40:44 +09:00
okkez
6dbe2272cf
Set proper class to subclass of Array
...
More compatibility to CRuby.
2017-03-29 08:02:21 +09:00
Clayton Smith
a6e25f73a0
Renumber hash keys during dup since there may be duplicates.
2017-03-28 16:31:19 -04:00
Yukihiro "Matz" Matsumoto
5ec051fc34
Avoid inline local variable declarations; fix #3554
2017-03-28 18:22:05 +09:00
Yukihiro "Matz" Matsumoto
1bdaf9c840
Merge pull request #3553 from okkez/add-array-slice-bang
...
Implement Array#slice!
2017-03-28 15:24:52 +09:00
Kenji Okimoto
33f77fe367
Implement Array#slice!
2017-03-28 15:07:57 +09:00
Yukihiro "Matz" Matsumoto
0f5289326f
Merge pull request #3552 from ksss/time
...
Fix infinity loop ref #3546
2017-03-28 14:47:23 +09:00
ksss
397f1fc946
Fix infinity loop
...
And some cases should raise FloatDomainError
2017-03-28 10:58:18 +09:00
Yukihiro "Matz" Matsumoto
66980493ae
Merge pull request #3544 from ksss/lineno
...
Fix lost lineno
2017-03-27 11:50:18 +09:00
Yukihiro "Matz" Matsumoto
f688de5803
Merge pull request #3545 from keizo042/ignore_tags
...
Ignore file generated by ctags
2017-03-27 11:49:37 +09:00
Kouichi Nakanishi
d0e42eff00
Ignore file generated by ctags
2017-03-26 12:51:48 +09:00
ksss
b1c5c3b0a5
Fix lost lineno
2017-03-25 15:56:27 +09:00
Yukihiro "Matz" Matsumoto
051e40c049
Use MRB_PRId for NODE_NTH_REF; ref #3530
2017-03-23 01:52:52 +09:00
Yukihiro "Matz" Matsumoto
9eb0c11afd
Cast to mrb_int to silence a warning; fix #3530
2017-03-23 01:20:45 +09:00
Yukihiro "Matz" Matsumoto
41f5c5b2c7
Merge pull request #3529 from kou/hash-ext-sub-class
...
Hash sub class creates new sub class objects instead of Hash
2017-03-23 01:14:46 +09:00
Yukihiro "Matz" Matsumoto
8ca9823196
Merge pull request #3536 from ksss/string-sub
...
Fix result if pattern is empty
2017-03-23 00:49:06 +09:00
ksss
63c0044b11
Fix result if pattern is empty
2017-03-22 22:19:34 +09:00
Kouhei Sutou
e72e50b5d5
Hash sub class creates new sub class objects instead of Hash
2017-03-21 23:25:36 +09:00
Yukihiro "Matz" Matsumoto
3703aed7ab
Use snprintf() to stringify fixnum numbers; ref #3492
2017-03-20 11:47:15 +09:00
Yukihiro "Matz" Matsumoto
339c6aed64
Add explicit cast from float to mrb_int.
2017-03-20 02:54:21 +09:00
Yukihiro "Matz" Matsumoto
631de65e0c
Merge pull request #3527 from ksss/string-gsub
...
Update String#gsub and String#gsub!
2017-03-20 02:23:11 +09:00
Yukihiro "Matz" Matsumoto
dcf6a413ca
Use snprintf() to stringify fixnum numbers; fix #3492
2017-03-20 01:39:33 +09:00
Yukihiro "Matz" Matsumoto
cea6a16cf4
Fixed some compiler errors regarding PRId.
2017-03-19 23:42:49 +09:00
ksss
7a74a617ea
Callback should yield with pattern every time
2017-03-19 23:04:22 +09:00
ksss
67a6982710
Support to return Enumerator for String#gsub,gsub!
2017-03-19 22:45:14 +09:00
Yukihiro "Matz" Matsumoto
09574922a9
Should not check/call to_str for immediate objects; ref #3515
2017-03-19 20:59:30 +09:00
Yukihiro "Matz" Matsumoto
527dcd5247
super class error formats the superclass by inspect; rerf #3515
2017-03-19 20:58:34 +09:00
Yukihiro "Matz" Matsumoto
ef105b5ca4
Use MRB_PRId instead of "%d"; fix #3515
2017-03-19 20:43:25 +09:00
Yukihiro "Matz" Matsumoto
4cf38eb903
Fixed OP_RESCUE code generation bug; fix #3519
...
916b8e let code executed with mrb->exc set, and may cause a crash
like #3519 . Instead modified OP_RESCUE again. To retrieve the exception
object, we use `OP_RESCUE R(A), 0, 0` (old behavior). To compare the
exception object and the class, we use `OP_RESCUE R(A), R(B), 1`.
The reason we use OP_RESCUE for two instruction switched by operand
C is to save the instruction space.
As a result, the following code:
```ruby
begin
raise "a"
rescue TypeError
p 1
rescue RuntimeError
p 2
end
```
will be compiled as:
```
irep 0x55cd1f565cb0 nregs=4 nlocals=1 pools=1 syms=4 reps=0
file: -
2 000 OP_ONERR 005
2 001 OP_LOADSELF R1
2 002 OP_STRING R2 L(0) ; "a"
2 003 OP_SEND R1 :raise 1
2 004 OP_JMP 023
2 005 OP_RESCUE R1
3 006 OP_GETCONST R2 :TypeError
3 007 OP_RESCUE R1 R2 cont
3 008 OP_JMPIF R2 010
3 009 OP_JMP 014
4 010 OP_LOADSELF R1
4 011 OP_LOADI R2 1
4 012 OP_SEND R1 :p 1
4 013 OP_JMP 024
5 014 OP_GETCONST R2 :RuntimeError
5 015 OP_RESCUE R1 R2 cont
5 016 OP_JMPIF R2 018
5 017 OP_JMP 022
6 018 OP_LOADSELF R1
6 019 OP_LOADI R2 2
6 020 OP_SEND R1 :p 1
6 021 OP_JMP 024
6 022 OP_RAISE R1
6 023 OP_POPERR 1
6 024 OP_STOP
```
2017-03-19 18:42:53 +09:00
Yukihiro "Matz" Matsumoto
d01118d261
OP_RESCUE refactored; ref #3519
2017-03-19 18:40:58 +09:00
Yukihiro "Matz" Matsumoto
8d1468eab4
Remove cname duplication from exc_inspect().
2017-03-19 08:05:19 +09:00
Yukihiro "Matz" Matsumoto
e6b5c75ec5
Avoid possible infinite recursion in mrb_print_error(); ref #3517
2017-03-19 07:20:44 +09:00
Yukihiro "Matz" Matsumoto
2cbbeba0e0
Check call depth when mrb_yield_class() is called; ref #3521
2017-03-19 00:28:52 +09:00
Yukihiro "Matz" Matsumoto
75c374cad3
Update stack only when callinfo is popped; fix #3521
2017-03-19 00:28:52 +09:00
Yukihiro "Matz" Matsumoto
6db38c3768
Need not to call mrb_obj_as_string() is sep is nil.
2017-03-19 00:28:52 +09:00
Yukihiro "Matz" Matsumoto
ce8697523f
Merge pull request #3526 from ksss/sprintf
...
sprintf: Should use mrb_int for any object
2017-03-18 23:30:35 +09:00
ksss
2005bf997f
Should use mrb_int for any object
...
o=Object.new
def o.to_int
1
end
p "%*d" % [o, 1]
2017-03-18 22:06:01 +09:00
Yukihiro "Matz" Matsumoto
fa502b498e
Need to setup singleton_class chain; fix #3509
2017-03-18 18:06:37 +09:00
Yukihiro "Matz" Matsumoto
38a3b89d39
Small cosmetic change ("* " -> "*").
2017-03-18 17:38:07 +09:00
Yukihiro "Matz" Matsumoto
6ea26aafd5
Save/restore GC arena index to avoid arena overflow error.
2017-03-18 17:37:24 +09:00
Yukihiro "Matz" Matsumoto
00427d45f5
Fixed access of uninitialized C local variable; fix #3525
2017-03-18 17:34:29 +09:00
Yukihiro "Matz" Matsumoto
b2916f1b5c
Avoid mrb_check_string_type() in raising exception; fix #3506
...
The change may reduce flexibility, but I believe no one wants
that level of flexibility here.
2017-03-18 02:34:56 +09:00
Yukihiro "Matz" Matsumoto
27fc76f6c6
Merge pull request #3524 from ksss/timestamp
...
MiniRake::Task#timestamp should use Time.now only
2017-03-17 16:00:50 +09:00
Yukihiro "Matz" Matsumoto
fca17b41c7
Avoid trampoline when #eval is called from mrb_funcall(); fix #3522
2017-03-17 15:55:18 +09:00
ksss
f99e100187
MiniRake::Task#timestamp should use Time.now only
2017-03-17 12:41:06 +09:00
Yukihiro "Matz" Matsumoto
9ecebebf3e
Merge pull request #3510 from ksss/string-each_line
...
Some update for `String#each_line`
2017-03-16 22:18:15 +09:00
Yukihiro "Matz" Matsumoto
47cc5d66e3
Singleton classes do not have outer class set; fix #3505
2017-03-16 22:13:58 +09:00
Yukihiro "Matz" Matsumoto
b64f08784c
Protect stack region before calling mrb_convert_type(); fix #3504
2017-03-16 21:40:22 +09:00
ksss
4ee79a8777
Support to return enumerator when no block given
2017-03-15 16:58:29 +09:00
ksss
673ce237c4
Suuport custom separator
2017-03-15 16:58:28 +09:00
ksss
6eb02a892d
Use duplicated object for block args
2017-03-15 16:58:28 +09:00
Yukihiro "Matz" Matsumoto
f8b31a0db6
instance_eval method does not introduce C function boundary; fix #3508
2017-03-15 09:00:03 +09:00
Yukihiro "Matz" Matsumoto
4b1e5d47b3
Merge pull request #3503 from nobu/bug/sprintf-oob
...
Fix out-of-bound access
2017-03-14 09:07:06 +09:00
Nobuyoshi Nakada
d8c4fe7bcb
Fix out-of-bound access
...
Get rid of out-of-bound access when single % at the end.
2017-03-13 23:56:33 +09:00
Yukihiro "Matz" Matsumoto
191ee2596c
Need to copy argv since it may be reallocated; fix #3500
...
The argv for `mrb_yield_with_class()` should not be on mruby stack.
Note the result from `mrb_get_args("*")` is on the stack.
2017-03-13 22:51:53 +09:00
Yukihiro "Matz" Matsumoto
877f43bca5
OP_BLKPUSH is invalid outside of methods; fix #3501
2017-03-13 22:03:31 +09:00
Yukihiro "Matz" Matsumoto
916b8ed5c8
Generate new OP_RESCUE; fix #3487
...
The old OP_RESCUE took one operand A, which specifies a class
to match with the exception. The new OP_RESCUE takes tree operands:
A: the register to hold exception
B: the matching exception; the match result will be stored here.
C: the continuation; if C is zero, the exception will be stored to R(A)
otherwise, the value from R(A) is used as a exception.
Thus,
```ruby
begin
raise "a"
rescue TypeError
p 1
rescue RuntimeError
p 2
end
```
will be compiled as
```
irep 0x557a06667aa0 nregs=4 nlocals=1 pools=1 syms=4 reps=0
file: /tmp/e.rb
2 000 OP_ONERR 005
2 001 OP_LOADSELF R1
2 002 OP_STRING R2 L(0) ; "a"
2 003 OP_SEND R1 :raise 1
2 004 OP_JMP 022
3 005 OP_GETCONST R2 :TypeError
3 006 OP_RESCUE R1 R2
3 007 OP_JMPIF R2 009
3 008 OP_JMP 013
4 009 OP_LOADSELF R1
4 010 OP_LOADI R2 1
4 011 OP_SEND R1 :p 1
4 012 OP_JMP 023
5 013 OP_GETCONST R2 :RuntimeError
5 014 OP_RESCUE R1 R2 cont
5 015 OP_JMPIF R2 017
5 016 OP_JMP 021
6 017 OP_LOADSELF R1
6 018 OP_LOADI R2 2
6 019 OP_SEND R1 :p 1
6 020 OP_JMP 023
6 021 OP_RAISE R1
6 022 OP_POPERR 1
6 023 OP_STOP
```
The new VM can accept old OP_RESCUE. The mruby compatible VM (namely
mruby/c) should be updated to support the new OP_RESCUE behavior.
2017-03-12 01:10:20 +09:00
Yukihiro "Matz" Matsumoto
92f5becabe
Update VM to support new OP_RESCUE behavior; ref #3487
2017-03-12 00:58:00 +09:00
Yukihiro "Matz" Matsumoto
26169f9e25
Enhance OP_RESCUE to take B operand fas matching exception; ref #3487
2017-03-12 00:50:38 +09:00
Yukihiro "Matz" Matsumoto
000c68da97
OP_RETRUN to take B as matching exception; ref #3487
2017-03-11 16:32:29 +09:00
Yukihiro "Matz" Matsumoto
4ab70294ea
Revert 642ab8e; ref #3422
...
Also fix #3499 . The issue was solved by #3462 .
2017-03-11 16:03:04 +09:00
Yukihiro "Matz" Matsumoto
94395e81c1
The width printf specifier may be negative; fix #3498
2017-03-11 15:22:54 +09:00
Yukihiro "Matz" Matsumoto
f30ec2dfb0
fixup! Check return value from snprintf(); ref #3498
2017-03-11 15:22:42 +09:00
Yukihiro "Matz" Matsumoto
e3922318bd
Check return value from snprintf(); ref #3498
2017-03-11 15:18:41 +09:00
Yukihiro "Matz" Matsumoto
f9ed15d899
Merge pull request #3496 from ksss/string-gsub
...
Avoid infinity loop when empty string pattern
2017-03-11 10:22:34 +09:00
Yukihiro "Matz" Matsumoto
7590482d48
Merge branch 'master' into string-gsub
2017-03-11 10:22:17 +09:00
Yukihiro "Matz" Matsumoto
431f474ba3
Merge pull request #3497 from ksss/subreplace
...
\1 sequences as empty strings
2017-03-11 10:19:59 +09:00
ksss
b56ad8d122
\1 sequences as empty strings
2017-03-10 22:22:06 +09:00
ksss
4b3e6cf169
Avoid infinity loop when empty string pattern
2017-03-10 13:26:15 +09:00
Yukihiro "Matz" Matsumoto
ff262f2133
Update ci->mid according to surrounding scope; fix #3490
2017-03-10 12:37:19 +09:00
Yukihiro "Matz" Matsumoto
2f299cf4dc
Simplify expression; ref #3490
2017-03-10 12:36:58 +09:00
Yukihiro "Matz" Matsumoto
e8f09f9393
Raise special Exception when exception class is redefined; fix #3493
2017-03-10 11:43:25 +09:00
Yukihiro "Matz" Matsumoto
c6e5659fec
Use string#upto() if available; fix #3489
...
Terminate loop if the value is longer than the last otherwise.
2017-03-10 10:39:43 +09:00
Yukihiro "Matz" Matsumoto
4763312fb8
Terminate loop if generated string longer than the last; ref #3489
2017-03-10 10:38:28 +09:00
Yukihiro "Matz" Matsumoto
63dbed0094
__FILE__ should not update p->filename; fix #3485
2017-03-07 15:01:09 +09:00
Yukihiro "Matz" Matsumoto
513f4fbf14
Merge pull request #3484 from ksss/string-frozen
...
Check modifiable for String `bang' methods
2017-03-06 07:38:56 +09:00
Yukihiro "Matz" Matsumoto
8a15abdac2
Avoid trampoline code if mrb_f_send is called from funcall; fix #3383
2017-03-06 07:35:41 +09:00
ksss
eba4b1fd76
Check modifiable for String `bang' methods
2017-03-05 23:04:22 +09:00
Yukihiro "Matz" Matsumoto
d050694580
Merge pull request #3483 from ksss/string-index
...
String#index shouldn't return nil when "".index ""
2017-03-05 20:27:28 +09:00
ksss
76e10351fa
String#index shouldn't return nil when "".index ""
2017-03-05 14:15:18 +09:00
Yukihiro "Matz" Matsumoto
4f43db862a
Unshare popped TT_ENV objects.
2017-03-04 22:45:44 +09:00
Yukihiro "Matz" Matsumoto
3b40a2f6b5
Limit ecall() recursion levels; fix #3466
2017-03-04 18:56:20 +09:00
Yukihiro "Matz" Matsumoto
ecee8c51b0
Avoid tracing shared TT_ENV object.
2017-03-04 18:53:36 +09:00
Yukihiro "Matz" Matsumoto
c789acbc36
Save/restore arena index in the loop.
2017-03-04 18:52:51 +09:00
Yukihiro "Matz" Matsumoto
ffdf7be723
Define jmpbuf_id outside of extern "C"; ref #3470
2017-03-02 20:42:06 +09:00
Yukihiro "Matz" Matsumoto
2d858cab3d
Use C++ ABI only when MRB_ENABLE_CXX_ABI is set; ref #3470
2017-03-02 20:37:21 +09:00
Yukihiro "Matz" Matsumoto
1ab7e7e4dc
Fixed a bug in register size calculation; fix #3479
2017-03-02 18:14:36 +09:00
Yukihiro "Matz" Matsumoto
3390020fd0
The method_missing removal condition in a76dc04a was wrong.
2017-03-02 17:59:27 +09:00
Yukihiro "Matz" Matsumoto
27ec2437fd
Fix possible stack overflow for method_missing; fix #3478
...
Instead of shifting mruby VM stack, we always use CALL_MAXARGS.
2017-03-02 17:55:15 +09:00
Yukihiro "Matz" Matsumoto
0bcf9e28fc
Reorganize C++ exceptions; ref #3470
...
There are 3 levels of C++ exception handling:
* default - no C++ exception (use setjmp/longjmp)
* enable_cxx_exception (use C++ exceptions with C ABI)
* enable_cxx_abi (use C++ ABI including exceptions)
2017-03-02 10:58:26 +09:00
Yukihiro "Matz" Matsumoto
fdd92750fe
Create NoMethodError instance using mrb_obj_new().
2017-03-02 10:56:23 +09:00
Yukihiro "Matz" Matsumoto
9b176a1ca8
Avoid using <mruby/throw.h> in mruby.c
2017-03-02 10:51:44 +09:00
Yukihiro "Matz" Matsumoto
eca35df4ff
ci may be moved during mrb_convert_type(); ref #3474
2017-03-01 12:06:18 +09:00
Yukihiro "Matz" Matsumoto
8b089c09f7
Keep space for safe navigation operator; fix #3475
2017-03-01 10:37:43 +09:00
Yukihiro "Matz" Matsumoto
cd0ac59dd3
Newlines in strings should be counted; fix #3477
2017-03-01 00:05:54 +09:00
Yukihiro "Matz" Matsumoto
1a1f834ade
Compile C files by C compiler when C++ files mixed.
...
ref #3267 #3470
By this commit, mruby do not use C++ ABI mode unless
you specify explicitly. It compiles C files by C
compilers, with C++ exception enabled when it sees
C++ files in your configured mrbgems.
I haven't tried visualcpp, so please submit an issue
if you see any problem with C++ gems on Windows.
2017-02-28 23:27:13 +09:00
Yukihiro "Matz" Matsumoto
dc56bbecc8
Ignore empty ensure clause.
2017-02-28 11:51:17 +09:00
Yukihiro "Matz" Matsumoto
fb3243e096
return (and break) should handle splat correctly; fix #3472
2017-02-28 11:34:54 +09:00
Yukihiro "Matz" Matsumoto
22eb41ab20
Fix NODE_DREGX dump; ref #3471
2017-02-28 10:56:34 +09:00
Yukihiro "Matz" Matsumoto
c52bbe1b4e
Fixed a bug in dregex option generation; fix #3471
2017-02-28 10:43:22 +09:00
Yukihiro "Matz" Matsumoto
89eac4f59d
Update codegen.c comments
2017-02-28 10:32:40 +09:00
Yukihiro "Matz" Matsumoto
7db0786abd
Fix integer overflow; fix #3473
...
The fix is suggested by https://hackerone.com/lucnguyen
2017-02-28 09:54:56 +09:00
Yukihiro "Matz" Matsumoto
405f5a2d2a
Add type check by mrb_get_args(); ref #3476
2017-02-28 09:30:06 +09:00
Yukihiro "Matz" Matsumoto
74dbee8e52
Add check before calling str_substr(); ref #3476
2017-02-28 09:21:24 +09:00
Yukihiro "Matz" Matsumoto
bdac7dfae8
Check if the value is fixnum before mrb_funcall(); fix #3476
...
The issue is reported by https://hackerone.com/aerodudrizzt
2017-02-28 09:14:42 +09:00
Yukihiro "Matz" Matsumoto
a76dc04aa8
Remove default Kernel#method_missing.
...
Internal method_missing works without problems.
2017-02-27 23:11:39 +09:00
Yukihiro "Matz" Matsumoto
b563bcb7ff
Check if OP_RETURN cross C function boundary; fix #3462
2017-02-27 20:13:01 +09:00
Yukihiro "Matz" Matsumoto
50bbdbb11b
Fixed ecall() invoked too early; fix #3464
2017-02-27 18:40:35 +09:00
Yukihiro "Matz" Matsumoto
3fc9bf3d5f
Update local variable only after the value is checked.
2017-02-27 18:39:42 +09:00
Yukihiro "Matz" Matsumoto
d219e63a74
Clear block arg when method_missing takes *args.
2017-02-27 18:38:56 +09:00
Yukihiro "Matz" Matsumoto
9e93d5dbf0
Stack may be reallocated in mrb_run(); fix #3465
2017-02-27 16:17:57 +09:00
Yukihiro "Matz" Matsumoto
736be0e98b
Always keep block argument space in stack; fix #3469
2017-02-27 13:05:26 +09:00
Yukihiro "Matz" Matsumoto
83a6c0e0a4
Merge pull request #3458 from dabroz/gitlab-ci
...
GitLab.com tests for multiple configurations
2017-02-27 08:59:33 +09:00
Yukihiro "Matz" Matsumoto
fecbde328a
Merge pull request #3461 from iij/build-with-byacc
...
Build with byacc
2017-02-24 18:39:20 +09:00
Tomoyuki Sahara
da4f8e19fa
replace "yylval" with "pylval" to make it compile with byacc.
2017-02-24 11:47:48 +09:00
Yukihiro "Matz" Matsumoto
a9f7b41219
Merge pull request #3460 from AltimitSystems/android.rake-ndk-clang
...
Additional options for Android build script.
2017-02-17 01:13:37 +09:00
Felix Jones
fd08e0ea3a
Added example build script for Android armeabi-v7a NEON hardware FPU
2017-02-16 15:07:18 +00:00
Felix Jones
324231a733
Android toolchain separated target architecture compile flags (ctarget) from shared compile flags (cflags). Added support for custom mfpu and float-abi switches for the armeabi-v7a target.
2017-02-16 15:02:10 +00:00
Yukihiro "Matz" Matsumoto
73e5a19c39
Configure callinfo target_class as CRuby; ref #3429
2017-02-16 23:43:02 +09:00
Yukihiro "Matz" Matsumoto
4dae285325
Merge pull request #3457 from dabroz/fix-clang-32-64
...
Build fix for 32-bit clang 3.8/3.9 with MRB_INT64
2017-02-16 23:21:58 +09:00
Yukihiro "Matz" Matsumoto
097da2399a
Avoid executing OP_STOP in eval(); fix #3429
2017-02-16 22:40:31 +09:00
Yukihiro "Matz" Matsumoto
5e3c329c98
Adjust callinfo env and target_class; ref #3429
2017-02-16 22:38:47 +09:00
Felix Jones
d83aad8d57
Merge branch 'master' into android.rake-ndk-clang
2017-02-16 13:33:46 +00:00
Tomasz Dabrowski
bc721ec45d
Gitlab tests for multiple configurations
...
Gitlab testing is introduced, using GitLab CI, to test many different configurations:
- 32/64 bit architecture
- float/double
- 16/32/64 bit int size
- none/NaN/word boxing
- ASCII/UTF8
using various compilers:
- gcc-4.7
- gcc-4.8
- gcc-4.9
- gcc-5
- gcc-6
- clang-3.5
- clang-3.6
- clang-3.7
- clang-3.8
- clang-3.9
2017-02-16 13:50:27 +01:00
Tomasz Dabrowski
bd2b76ea85
Build fix for 32-bit clang 3.8/3.9 with MRB_INT64
2017-02-16 13:39:21 +01:00
Yukihiro "Matz" Matsumoto
b165708c8d
Move #instance_exec to Kernel module
...
CRuby defines #instance_exec in BasicObject, but we don't.
It's a small incompatibility that isn't worth accomplish at
the price of implementation complexity.
2017-02-15 13:24:03 +09:00
Yukihiro "Matz" Matsumoto
517e9313bf
Move #__id__ to BasicObject; ref #3417
2017-02-15 13:19:21 +09:00
Yukihiro "Matz" Matsumoto
612d636b77
Move #instance_eval to BasicObject; ref #3417
2017-02-15 13:15:58 +09:00
Yukihiro "Matz" Matsumoto
3dbda91788
Move #__send__ to BasicObject; ref #3417
2017-02-15 13:12:05 +09:00
Yukihiro "Matz" Matsumoto
8b4bd3158b
Move #== and #!= to BasicObject; ref #3417
2017-02-15 13:07:53 +09:00
Yukihiro "Matz" Matsumoto
3f9450e7b0
Move BasicObject#method_missing to Kernel#method_missing; ref #3417
...
More compatibility to CRuby.
Updated tests that assume old mruby behavior.
2017-02-15 12:56:27 +09:00
Yukihiro "Matz" Matsumoto
1e5b5b14d7
Prohibit too deep mrb_funcall() recursion; ref #3421
...
`mrb_funcall()` recursion can cause stack overflow easily,
so recursion depth is now limited to MRB_FUNCALL_DEPTH_MAX,
which default value is 512.
2017-02-15 12:06:32 +09:00
Yukihiro "Matz" Matsumoto
1e57fefbcf
Do not funcall() Exception#set_backtrace from runtime.
...
This change reduce flexibility but makes mruby simpler and faster.
2017-02-15 12:01:52 +09:00
Yukihiro "Matz" Matsumoto
8efa7b00df
Preallocate SystemStackError; ref #3421
2017-02-15 11:59:47 +09:00
Yukihiro "Matz" Matsumoto
0376d4d4c6
Merge pull request #3455 from crimsonwoods/fix-android-build-script
...
Update android build script.
2017-02-15 10:30:27 +09:00
Yukihiro "Matz" Matsumoto
dd24f9f5cc
Avoid calling hook methods if they are not overridden.
2017-02-15 09:25:09 +09:00
Yukihiro "Matz" Matsumoto
04296925ac
Use mrb_funcall_argv() instead of mrb_funcall()
2017-02-15 09:24:35 +09:00
crimsonwoods
5395dbfb3a
Add new two build config files.
2017-02-15 09:01:55 +09:00
crimsonwoods
a6b1e964a3
Modify default cflags.
2017-02-15 03:03:47 +09:00
crimsonwoods
838fa69aa3
Add '-Wl,--fix-cortex-a8' linker option for 'armeabi-v7a' architecture.
2017-02-15 00:51:10 +09:00
crimsonwoods
83a3da4456
Set default linker 'flags' and 'flags_before_libraries'.
2017-02-15 00:36:02 +09:00
Yukihiro "Matz" Matsumoto
ba812d25ad
Merge pull request #3453 from palkan/fix/test-gems-setup
...
Separate compilers setup from config setup
2017-02-14 09:09:34 +09:00
palkan
131566753d
Separate compilers setup from config setup
...
Fixes #3418 .
2017-02-13 20:59:07 +03:00
Yukihiro "Matz" Matsumoto
30aa521854
Do not use mrb_funcall() if Hash#default is not overridden; ref #3421
...
This change reduces the recursion level, but does not solve the stack
overflow issue entirely.
2017-02-14 00:22:12 +09:00
Yukihiro "Matz" Matsumoto
719f700adf
Extend mruby stack when keep is bigger than room; fix #3421
...
But #3421 still cause stack overflow error due to infinite recursion.
To prevent overflow, we need to add different stack depth check.
2017-02-14 00:15:58 +09:00
Yukihiro "Matz" Matsumoto
ecb6ac8b4a
Fixed codegen error of redo in rescue; fix #3422
...
The issue (and the fix) was reported by https://hackerone.com/dgaletic
2017-02-13 19:31:06 +09:00
Yukihiro "Matz" Matsumoto
c2ddcd4517
Should handle break from funcall(); fix #3434
...
This issue was reported by https://hackerone.com/d4nny
2017-02-13 18:45:20 +09:00
Yukihiro "Matz" Matsumoto
f198530444
Fixed too much value_copy() when block is not given; fix #3440
...
The issue was reported by https://hackerone.com/titanous
2017-02-13 18:18:09 +09:00
Yukihiro "Matz" Matsumoto
b23874777d
Merge pull request #3452 from dabroz/fix-kernel-caller-aspec
...
Fixed aspec for Kernel#caller
2017-02-12 20:46:10 +09:00
Tomasz Dabrowski
e4fa59f5ed
Fixed aspec for Kernel#caller
2017-02-12 11:15:40 +01:00
Yukihiro "Matz" Matsumoto
60664823ba
Merge pull request #3451 from dabroz/revert-string-mul
...
Revert "Optimization for String#* for 1-byte strings"
2017-02-11 22:49:20 +09:00
Yukihiro "Matz" Matsumoto
1f2d786e32
Avoid direct return from ecall(); fix #3441
...
There's incompatibility left for mruby.
When you return from `ensure` clause, mruby simply ignores the return
value. CRuby returns from the method squashing the exception raised.
```
def f
no_such_method() # NoMethodError
ensure
return 22
end
p f() # CRuby prints `22`
```
2017-02-11 21:58:47 +09:00
Tomasz Dabrowski
90f262f642
Revert "Optimization for String#* for 1-byte strings"
...
This reverts commit d1bc7caeca .
2017-02-11 13:02:48 +01:00
Yukihiro "Matz" Matsumoto
ff03a9a61c
Avoid integer overflow in sprintf(); fix #3439
...
This issue was reported by https://hackerone.com/aerodudrizzt
2017-02-11 20:35:52 +09:00
Yukihiro "Matz" Matsumoto
642ab8ecda
ecall() should preserve stack address referenced from ci[1].
...
OP_RETURN accesses ci[1]->stackent that might be broken; fix #3442
2017-02-11 18:13:39 +09:00
Yukihiro "Matz" Matsumoto
0b143898c4
Remove historical comment; ref #3450 #3448
2017-02-11 16:52:45 +09:00
Yukihiro "Matz" Matsumoto
0ef51d83c2
Merge pull request #3450 from r-obert/patch-1
...
remove skip that shouldn't be necessary anymore.
2017-02-11 16:50:06 +09:00
robert
b130f43298
remove skip that shouldn't be necessary anymore.
...
the test should pass after https://github.com/mruby/mruby/commit/8f4a929e1a01c8d6176fb53a9ef5dff6de632959 .
2017-02-11 07:40:55 +00:00
Yukihiro "Matz" Matsumoto
8f4a929e1a
String#replace should update s->flags for MRB_STR_NO_UTF.
...
Otherwise String#size may return wrong length; fix #3448
2017-02-11 16:27:07 +09:00
Yukihiro "Matz" Matsumoto
6cb7aef563
Add type cast to pacify warning
2017-02-11 16:00:26 +09:00
Yukihiro "Matz" Matsumoto
b36495bcb5
Merge pull request #3449 from dabroz/fix-ljust-ruby
...
String#ljust and String#rjust reimplemented with optimized Ruby
2017-02-11 10:26:09 +09:00
Tomasz Dabrowski
d1bc7caeca
Optimization for String#* for 1-byte strings
2017-02-10 15:31:33 +01:00
Tomasz Dabrowski
ac9d04f4af
String#ljust and String#rjust reimplemented with optimized Ruby
2017-02-10 15:31:33 +01:00
Tomasz Dabrowski
24048cd998
Tests for UTF-8 String#ljust and String#rjust
2017-02-10 15:16:49 +01:00
Yukihiro "Matz" Matsumoto
c802cd07ba
Merge pull request #3446 from ksss/minirake
...
Fix build error when trace mode
2017-02-10 21:22:00 +09:00
Yukihiro "Matz" Matsumoto
0dc26f52a0
Merge pull request #3447 from dabroz/fix-ljust
...
String#ljust and String#rjust reimplementation (fix #3445 )
2017-02-10 21:20:26 +09:00
Tomasz Dabrowski
981105b3e6
String#ljust and String#rjust reimplementation ( fix #3445 )
...
- String#ljust and String#rjust are now C functions to improve performance
- infinite loop because of an empty padding argument is now prevented (ArgumentError is raised)
- extra tests for ljust/rjust added
2017-02-10 12:59:28 +01:00
ksss
cd8284fe0b
Fix build error when trace mode
...
Rakefile
```
file "a.txt" do
system "echo hello > a.txt"
end
file "b.txt" => "a.txt" do
system "cp a.txt b.txt"
end
task :default => "b.txt"
```
```
$ touch b.txt
$ ruby minirake --trace
Invoke default (already=[], needed=[true])
rake aborted!
No such file or directory @ rb_file_s_stat - a.txt
minirake:241:in `stat'
minirake:241:in `timestamp'
minirake:233:in `block in needed?'
minirake:233:in `collect'
minirake:233:in `needed?'
minirake:91:in `invoke'
minirake:95:in `block in invoke'
minirake:95:in `each'
minirake:95:in `invoke'
minirake:467:in `block in run'
minirake:466:in `each'
minirake:466:in `run'
minirake:484:in `<main>'
```
2017-02-10 13:15:49 +09:00
Yukihiro "Matz" Matsumoto
d0ecf862d9
Fixed mixture of signed/unsigned integers
...
in mrbgems/mruby-bin-debugger.
2017-02-08 23:27:17 +09:00
Yukihiro "Matz" Matsumoto
4b32e651a5
Check if irep is NULL before print_backtrace()
...
According to the valgrind log attached to #3438 , proc->body.irep
may be NULL in some cases.
2017-02-08 23:10:25 +09:00
Yukihiro "Matz" Matsumoto
af4d74fc7d
Add MRB_TT_PROC check to OP_SUPER as well; fix #3432
2017-02-08 21:13:22 +09:00
Yukihiro "Matz" Matsumoto
76135e757f
Check if m->env is NULL before dereferencing it; fix #3436
2017-02-08 19:01:09 +09:00
Yukihiro "Matz" Matsumoto
b277c58e78
Mark classes referenced from saved backtrace.
...
Maybe related to #3438
2017-02-08 16:31:37 +09:00
Yukihiro "Matz" Matsumoto
f3d4ff16d3
Fixed a bug in ci address shifting; fix #3423
...
Dinko Galetic and Denis Kasak reported the issue and the fix.
(via https://hackerone.com/dgaletic ).
2017-02-08 16:22:48 +09:00
Yukihiro "Matz" Matsumoto
be550f04e4
codedump.c: OP_POPERR does not have register access.
2017-02-08 09:45:55 +09:00
Yukihiro "Matz" Matsumoto
7eebbce42f
Merge pull request #3437 from eboda/master
...
Fix interpolation escaping in String.inspect
2017-02-08 08:58:41 +09:00
Edgar Boda-Majer
46e4e342f4
Fix interpolation escaping in String.inspect
2017-02-07 13:33:53 +01:00
Yukihiro "Matz" Matsumoto
794de3317a
Merge pull request #3430 from ksss/local_variables
...
Kernel#local_variables: Make result array unique
2017-02-06 15:58:53 +09:00
ksss
bd72dba8c0
Kernel#local_variables: Make result array unique
2017-02-06 11:16:47 +09:00
Yukihiro "Matz" Matsumoto
f2b18a604c
Check maximum number of formal arguments.
...
http://hkdnet.hatenablog.com/entry/2017/02/06/080000 (Japanese)
2017-02-06 09:14:49 +09:00
Yukihiro "Matz" Matsumoto
48e0bbbfee
Make eval to use trampoline technique; fix #3415
...
Now `eval()` can call Fiber.yield etc.
2017-02-04 16:19:31 +09:00
Yukihiro "Matz" Matsumoto
bf4e79cc62
argv may be modified when mrb_funcall() is called; fix #3419
...
Calling `mrb_funcall()` and `mrb_yield()` (and their related
functions) are discouraged unless absolutely necessary, because
it can cause this kind of issues very easily.
2017-02-04 14:10:39 +09:00
Yukihiro "Matz" Matsumoto
8f52b88ee7
No need to make env unshared in the finalization; fix #3425
2017-02-04 13:48:23 +09:00
Yukihiro "Matz" Matsumoto
8e0f231330
Mark mrb->backtrace.exc as GC root; fix #3388
2017-02-04 12:59:08 +09:00
Yukihiro "Matz" Matsumoto
6e0ba0085d
Jump address should fit in 16 bits range; fix #3426
2017-02-04 12:37:08 +09:00
Yukihiro "Matz" Matsumoto
a746ebe96f
Merge pull request #3420 from udzura/patch-1
...
Fix usage of Class#name in mruby-bin-mruby's bintest
2017-02-03 09:30:22 +09:00
Yukihiro "Matz" Matsumoto
e0323dff8c
Merge pull request #3427 from clayton-shopify/fix-mrb-random-init
...
Fetch arguments earlier in mrb_random_init to avoid a crash.
2017-02-03 09:29:46 +09:00
Clayton Smith
a8ccda5692
Fetch arguments earlier to avoid a crash.
2017-02-02 16:35:59 -05:00
Uchio KONDO
ab5812d0d8
Use standard Module(Class)#to_s
2017-02-02 18:09:27 +09:00
Yukihiro "Matz" Matsumoto
6420951463
Update example lines of mrbgems in build_config.rb; ref #3414
2017-01-25 15:38:25 +09:00
Yukihiro "Matz" Matsumoto
ac88f85a9e
Copy mrb_float values from pool when MRB_WORD_BOXING; ref #3396
2017-01-25 11:09:15 +09:00
Yukihiro "Matz" Matsumoto
51d7a69ab0
Clear (o).w first for MRB_WORD_BOXING; ref #3396
2017-01-25 11:07:57 +09:00
Yukihiro "Matz" Matsumoto
b3ce364537
Outer class may be same as the class; fix #3382
2017-01-24 17:54:05 +09:00
Yukihiro "Matz" Matsumoto
72bff2932b
Use size_t to avoid integer overflow in mrb_ary_splice(); fix #3413
2017-01-24 11:36:27 +09:00
Yukihiro "Matz" Matsumoto
28cf7a549d
Change return type of mrb_range_beg_len() from int to mrb_int.
...
ref #3411
2017-01-23 22:18:29 +09:00
Yukihiro "Matz" Matsumoto
f0f095bc13
Fix a double free problem in codegen.c; fix #3378
...
This issue was first reported by https://hackerone.com/geeknik
The fix was proposed by @titanous
2017-01-23 16:53:31 +09:00
Yukihiro "Matz" Matsumoto
3ce82603a5
Fix memory leak; ref #3378
...
The fix was proposed by @titanous
2017-01-23 16:48:18 +09:00
Yukihiro "Matz" Matsumoto
ffb5e5ab08
The ensure clause should keep its ci after its execution; fix #3406
...
This issue was reported by https://hackerone.com/ston3
2017-01-23 16:44:11 +09:00
Yukihiro "Matz" Matsumoto
324887d0d6
Backtrace list must be an array of strings; fix #3408
2017-01-23 16:23:48 +09:00
Yukihiro "Matz" Matsumoto
28b7b9ec64
Skip non string values in backtraces; ref #3408
2017-01-23 16:22:55 +09:00
Yukihiro "Matz" Matsumoto
40ec03c8c2
Merge pull request #3412 from ksss/mrb_ary_splice
...
Refactoring: Use array_copy instead of for loop
2017-01-23 15:24:56 +09:00
ksss
78a395d446
Refactoring: Use array_copy instead of for loop
2017-01-23 15:18:48 +09:00
Yukihiro "Matz" Matsumoto
4d38cad31b
Add MRB_API to mrb_range_beg_len(); ref #3411
2017-01-23 15:05:12 +09:00
Yukihiro "Matz" Matsumoto
5e1d923381
Changed the behavior of mrb_range_beg_len(); close #3411
...
The new API is:
int mrb_range_beg_len(mrb, range, &beg, &len, len, trunc)
The new argument `trunc` is a boolean value that specifies
whether the function truncates the range. The new return value
is an integer instead of a boolean, that is:
0: not a range
1: range with proper edges
2: out of range
To get the old behavior, you have to rewrite:
mrb_range_beg_len(mrb, range, &beg, &len, len)
to:
mrn_range_beg_len(mrb, range, &beg, &len, len, TRUE) == 1
[Breaking Change]
2017-01-23 14:35:26 +09:00
Yukihiro "Matz" Matsumoto
708088c5fa
Should not make empty strings shared; fix #3407
2017-01-23 10:52:40 +09:00
Yukihiro "Matz" Matsumoto
49fd7590df
Use mrb_write_barrier() instead of mrb_field_write_barrier_value()
...
ref #3409
2017-01-23 10:32:33 +09:00
Yukihiro "Matz" Matsumoto
fdec607cd0
Remove unnecessary inline declaration; ref #3409
2017-01-23 10:30:14 +09:00
Yukihiro "Matz" Matsumoto
9d0f07e6a7
Merge pull request #3409 from ksss/mrb_ary_splice
...
Rewrite mrb_ary_splice
2017-01-23 10:28:09 +09:00
Yukihiro "Matz" Matsumoto
39ce9fe585
Merge pull request #3410 from ksss/mrb_ary_aset
...
Should raise RuntimeError when object frozen
2017-01-23 00:24:00 +09:00
ksss
b49bd70f59
Should raise RuntimeError when object frozen
2017-01-22 18:53:20 +09:00
ksss
65c9baae7c
Rewrite mrb_ary_splice
...
Referenced to CRuby's array.c(rb_ary_splice)
fix #3405
2017-01-22 14:06:23 +09:00
Yukihiro "Matz" Matsumoto
bd50273bbc
Merge pull request #3404 from clayton-shopify/fix-block-params
...
Fix incorrect parsing of block parameters.
2017-01-21 23:52:26 +09:00
Clayton Smith
797ff625f3
Fix incorrect parsing of block parameters.
2017-01-21 09:08:37 -05:00
Yukihiro "Matz" Matsumoto
c48aef0b65
Stack position may be bigger than stack bottom; fix #3401
...
This issue was reported by https://hackerone.com/titanous
2017-01-21 18:01:12 +09:00
Yukihiro "Matz" Matsumoto
873b96bebc
Merge pull request #3402 from clayton-shopify/fix-masgn-optimization
...
Remove problematic optimization from NODE_MASGN codegen
2017-01-21 11:15:14 +09:00
Clayton Smith
2c0f8f1a23
Remove problematic optimization.
2017-01-20 18:40:18 -05:00
Yukihiro "Matz" Matsumoto
b23fb45f9c
Integral#step without arg should loop forever as CRuby does.
2017-01-20 17:58:29 +09:00
Yukihiro "Matz" Matsumoto
fe0e45505b
Initialize callinfo->acc; ref #3243
2017-01-18 17:53:08 +09:00
Yukihiro "Matz" Matsumoto
c8536d977d
Merge pull request #3362 from ksss/proc
...
Proc shouldn't have `initialize` method
2017-01-18 00:09:26 +09:00
Yukihiro "Matz" Matsumoto
c83069860a
Dots is not needed for base 10 negative numbers; fix #3400
2017-01-16 17:21:55 +09:00
Yukihiro "Matz" Matsumoto
c59ef59ad9
Merge pull request #3399 from ksss/caller
...
Implement Kernel.#caller
2017-01-16 17:11:47 +09:00
ksss
59d9f313df
Skip when backtrace doesn't get
2017-01-14 22:01:20 +09:00
ksss
6f9cb7406a
Implement Kernel.#caller
2017-01-14 22:01:20 +09:00
Yukihiro "Matz" Matsumoto
8d61f2120c
Add proper given argument number in the wrong-number-argument error.
2017-01-12 23:14:35 +09:00
Yukihiro "Matz" Matsumoto
a3571240e5
Add proper stack size calculation; fix #3398
...
This issue was reported by https://hackerone.com/ssarong
2017-01-12 23:08:58 +09:00
Yukihiro "Matz" Matsumoto
38acb9ec36
Kernel#initialize should not break existing mt; fix #3397
...
This issue was reported by https://hackerone.com/icanthack
The solution is suggested by @clayton-shopify.
2017-01-12 21:43:23 +09:00
Yukihiro "Matz" Matsumoto
41eff635bf
Merge pull request #3393 from clayton-shopify/fix-exc-initialize
...
Fix broken MRB_INT64
2017-01-12 15:31:32 +09:00
Yukihiro "Matz" Matsumoto
fb1dad82aa
Merge pull request #3394 from clayton-shopify/really-fix-nme
...
Fix 36fc1f14 not checking in the right location
2017-01-12 15:29:02 +09:00
Yukihiro "Matz" Matsumoto
a69d92e819
Merge pull request #3395 from hhc0null/fix-typo
...
Fix a typo in string.h.
2017-01-12 15:04:13 +09:00
hhc0null
af4f6e8dc6
Fix a typo.
2017-01-12 00:02:17 +09:00
Bouke van der Bijl
6be5160eb6
Fix 36fc1f14 not checking in the right location
2017-01-11 09:10:12 -05:00
Clayton Smith
bc4c90de07
Use mrb_int for argc.
2017-01-11 09:05:02 -05:00
Yukihiro "Matz" Matsumoto
db1bd078be
Use temporary variable to avoid potential crash; fix #3387
...
This issue was original reported by https://hackerone.com/icanthack
https://hackerone.com/titanous suggested the solution.
`regs` may be reallocated in the function call.
2017-01-11 17:59:56 +09:00
Yukihiro "Matz" Matsumoto
e1ff71029f
String#replace should check replacing string; fix #3374
...
This issue was reported by https://hackerone.com/tunz
2017-01-11 17:51:11 +09:00
Yukihiro "Matz" Matsumoto
06b2e6a76c
Check if ci->target_class is NULL before dereferencing
...
close #3389
This issue was reported by https://hackerone.com/ston3
2017-01-11 11:30:52 +09:00
Yukihiro "Matz" Matsumoto
44edc51612
Raises Exception if raising exception class is redefined
...
close #3384
This issue was reported by https://hackerone.com/brakhane
2017-01-11 10:29:55 +09:00
Yukihiro "Matz" Matsumoto
7523cdf340
Exception#initialize to take arbitrary number of args; ref #3384
2017-01-11 10:29:55 +09:00
Yukihiro "Matz" Matsumoto
c4491e477b
Validate tm values before timegm(); close #3368
...
This issue was reported by https://hackerone.com/volc
2017-01-09 10:42:11 +09:00
Yukihiro "Matz" Matsumoto
d3a8ebfadf
Merge pull request #3381 from sorah/asn
...
Put package's libs flag after %{objs}
2017-01-09 10:25:34 +09:00
Sorah Fukumori
ee7fc56dd0
Put package's libs flag after %{objs}
...
In case LDFLAG contains "-Wl,--as-needed" or "--as-needed" is enabled by
default, "-l" flags should appear after objs specifiction.
2017-01-09 10:08:06 +09:00
Yukihiro "Matz" Matsumoto
147c5c5441
Merge pull request #3380 from syucream/fix-assert
...
Pass when assert returns a false value
2017-01-07 19:37:55 +09:00
Ryo Okubo
f085baae06
Pass when assert returns a false value
2017-01-07 17:57:14 +09:00
Yukihiro "Matz" Matsumoto
392d7fbef9
Add ary_modify() checks; close #3379
...
This issue was reported by https://hackerone.com/an0n-j
2017-01-07 12:26:29 +09:00
Yukihiro "Matz" Matsumoto
8c11b04d5c
Merge pull request #3377 from ksss/respond_to
...
Check intern object returned by mrb_check_string_type
2017-01-06 18:56:39 +09:00
Yukihiro "Matz" Matsumoto
3c2f101aa4
Merge pull request #3376 from bovi/2017-copyright
...
Update Copyright to 2017
2017-01-06 18:52:22 +09:00
ksss
ddcb30d84b
Check intern object returned by mrb_check_string_type
2017-01-06 16:27:19 +09:00
Daniel Bovensiepen
2c77dfab04
Update Copyright to 2017
...
Signed-off-by: Daniel Bovensiepen <daniel@bovensiepen.net >
2017-01-06 14:27:57 +08:00
Yukihiro "Matz" Matsumoto
885d929398
Improve capacity enhancing conditions
2017-01-06 14:53:00 +09:00
Yukihiro "Matz" Matsumoto
c6a1172592
Add pointer cast to pacify warnings.
2017-01-06 14:52:04 +09:00
Yukihiro "Matz" Matsumoto
9a76a0bd80
Move mrb_assert() position.
2017-01-06 14:51:21 +09:00
Yukihiro "Matz" Matsumoto
5d0b9459ff
Merge pull request #3371 from takjn/removed_unnecessary_escape_charcter
...
Removed ununnecessary escape character '\' in libmruby.flags.mak
2017-01-06 14:35:10 +09:00
Yukihiro "Matz" Matsumoto
f53f73f30c
Should not deallocate shared string referring static; fix #3373
2017-01-06 14:25:01 +09:00
Jun Takeda
fe0884f37f
Removed ununnecessary escape character '\' for MRUBY_XXX in libmruby.flags.mak
2017-01-05 22:42:25 +09:00
Yukihiro "Matz" Matsumoto
36f5b44578
Add new method Kernel#frozen?; ref #3370
2017-01-05 17:49:21 +09:00
Yukihiro "Matz" Matsumoto
a10f85f855
Merge pull request #3369 from ksss/fix-str-prepend
...
Rewrite String#prepend with Ruby
2017-01-05 17:40:38 +09:00
Yukihiro "Matz" Matsumoto
2e0c2b5807
Add mrb_hash_modify() to Hash#{delete,clear}; ref #3370
...
This issue was reported by https://hackerone.com/an0n-j
2017-01-05 16:46:08 +09:00
ksss
eeca6ec8f5
Rewrite String#prepend with Ruby
...
Fix #3357
2017-01-04 14:00:28 +09:00
Yukihiro "Matz" Matsumoto
bc1259de3b
add explicit casts
2017-01-02 17:48:44 +09:00
Yukihiro "Matz" Matsumoto
f388b6d612
use size_t instead of int
2017-01-02 17:48:44 +09:00
Yukihiro "Matz" Matsumoto
158a6ab2ed
Merge pull request #3367 from ksss/str-modify
...
Fix segv on str_buf_cat
2017-01-02 17:48:27 +09:00
ksss
8a9a24152a
Fix memory error on str_buf_cat
...
Modify from nofree to embed string
2017-01-02 17:32:44 +09:00
ksss
30b6648b9c
Small refactoring: should use RSTR_CAPA
2017-01-02 16:33:58 +09:00
Yukihiro "Matz" Matsumoto
07167b8f5e
Initialize potentially uninitialized variable tsec.
2017-01-01 00:47:45 +09:00
Yukihiro "Matz" Matsumoto
8b77979667
Initialize potentially uninitialized variable z
2017-01-01 00:45:14 +09:00
Yukihiro "Matz" Matsumoto
1ed4de58d0
str_buf_cat(): better size check added; ref #3342
2016-12-31 23:33:34 +09:00
Yukihiro "Matz" Matsumoto
342b1de65c
str_buf_cat(): should allocate at least RSTRING_EMBED_LEN_MAX+1.
2016-12-31 23:31:45 +09:00
Yukihiro "Matz" Matsumoto
cfdd1e3cc6
ary_expand_capa(): refine conditions to avoid infinite loop; ref #3353
2016-12-31 23:22:17 +09:00
Yukihiro "Matz" Matsumoto
9d84f0d47b
ary_expand_capa(): size calculation by size_t; fix #3353
...
Also more size checks added.
2016-12-31 23:09:56 +09:00
Yukihiro "Matz" Matsumoto
270ea41b37
method_missing() may have CALL_MAXARGS-1 arguments; fix #3351
...
The issue was reported by https://hackerone.com/ston3
2016-12-30 22:09:32 +09:00
Yukihiro "Matz" Matsumoto
803bf010ca
save/restore arena index around yield; ref #3359
2016-12-28 13:00:28 +09:00
Yukihiro "Matz" Matsumoto
6af8cc36b9
Merge pull request #3366 from ksss/splice
...
Check array max size
2016-12-28 13:00:14 +09:00
ksss
caba1a19dc
Check array max size
...
Fix #3354
2016-12-27 15:48:53 +09:00
Yukihiro "Matz" Matsumoto
30d5424adf
Merge pull request #3365 from ksss/freeze
...
Fix segv when primitive value
2016-12-26 18:12:44 +09:00
ksss
5c1c002ac2
Fix segv when primitive value
...
Fix #3352
2016-12-25 16:52:10 +09:00
Yukihiro "Matz" Matsumoto
000a3119ca
Merge pull request #3364 from ksss/string2
...
Check overflow string length
2016-12-25 01:35:44 +09:00
Yukihiro "Matz" Matsumoto
ede04d68b3
Merge pull request #3363 from ksss/string
...
Do nothing when empty string
2016-12-25 00:43:01 +09:00
ksss
c626b823ca
Check overflow string length
...
Fix #3360
2016-12-23 23:31:21 +09:00
ksss
0de65a88d4
Do nothing when empty string
...
Fix #3361
2016-12-23 23:13:23 +09:00
ksss
a68b568911
Should call initialize method if defined
2016-12-22 10:40:13 +09:00
Yukihiro "Matz" Matsumoto
5e3077c00d
One less argument for raisef(); fix #3355
...
This issue was reported by https://hackerone.com/mg36
2016-12-21 16:46:26 +09:00
ksss
3cba13c249
Proc shouldn't have initialize method
...
Fix #3356
2016-12-21 15:17:05 +09:00
Yukihiro "Matz" Matsumoto
987daa64e3
Merge pull request #3358 from takjn/add-example-rx630
...
Added example for cross-compiling on Renesas RX630
2016-12-21 04:03:34 +09:00
Jun Takeda
76eb7147a4
Added example for cross-compiling for Renesas RX630
2016-12-21 00:51:18 +09:00
Yukihiro "Matz" Matsumoto
432570723d
Check if width is zero or negative before fill; fix #3347
...
Reported by https://hackerone.com/haquaman .
2016-12-18 02:02:30 +09:00
Yukihiro "Matz" Matsumoto
2edf15bed8
Prohibit mixture of posarg and nextarg; ref #3347
2016-12-18 02:02:30 +09:00
Yukihiro "Matz" Matsumoto
9781f7f0ea
Add "not reached" mark in mrb_ary_concat()
2016-12-18 02:02:30 +09:00
Yukihiro "Matz" Matsumoto
c2bbfa5b61
NODE_NEGATE cdr may not be code-node; fix #3348 ref #3324
...
Reported by Denis Kasak https://hackerone.com/dkasak
2016-12-18 02:02:30 +09:00
Yukihiro "Matz" Matsumoto
b0886d5692
Zero length heredoc still crashed; ref Shopify/mruby-internal#81
2016-12-18 02:02:30 +09:00
Yukihiro "Matz" Matsumoto
5289b4ba11
Merge pull request #3346 from clayton-shopify/fix-float-read
...
Fix crash when exponent is -2147483648
2016-12-17 12:18:35 +09:00
Clayton Smith
868d2e528f
Fix crash when exponent is -2147483648
2016-12-15 09:36:22 -05:00
Yukihiro "Matz" Matsumoto
73cc08772f
remove debug code; ref #3344
2016-12-14 13:34:24 +09:00
Yukihiro "Matz" Matsumoto
eb2a52ac98
Merge pull request #3345 from clayton-shopify/fix-range-beg-len
...
Check type before calling mrb_range_ptr.
2016-12-14 01:19:49 +09:00
Clayton Smith
73ad7395c0
Check type before calling mrb_range_ptr.
2016-12-13 10:04:15 -05:00
Yukihiro "Matz" Matsumoto
fead715cef
tLABEL should not come after conditional ternary; fix #3344
2016-12-13 23:44:10 +09:00
Yukihiro "Matz" Matsumoto
df35076602
Restore callinfo offset in mrb_yield_with_class()
2016-12-13 17:17:47 +09:00
Yukihiro "Matz" Matsumoto
d196e4dd04
void_expr_error(): n may be NULL.
...
Reported from @clayton-shopify.
2016-12-13 11:18:05 +09:00
Yukihiro "Matz" Matsumoto
3bedd22d55
Add assertion to make sure new capacity does not overflow.
2016-12-13 10:50:04 +09:00
Yukihiro "Matz" Matsumoto
3a7c369536
Make sure str->capa is under MRB_INT_MAX; fix #3342
2016-12-13 10:48:36 +09:00
Yukihiro "Matz" Matsumoto
647ad29a7a
Fixed wrong condition in new_sym() that breaks symbol data.
2016-12-13 02:33:28 +09:00
Yukihiro "Matz" Matsumoto
a4ae22ae0c
Failed to realloc irep->syms in certain condition.
...
Also msym size changed to 512 from 256.
2016-12-13 01:55:08 +09:00
Yukihiro "Matz" Matsumoto
9cef265402
should not try to set classpath for frozen classes; ref #3340
2016-12-12 10:34:21 +09:00
Yukihiro "Matz" Matsumoto
6ac5473494
Merge pull request #3341 from kou/support-pkg-config-in-mrbgem-rake
...
Support pkg-config in mrbgem.rake
2016-12-12 01:07:27 +09:00
Yukihiro "Matz" Matsumoto
1164463a7c
freeze classes/modules; ref #3340
2016-12-12 01:05:07 +09:00
Yukihiro "Matz" Matsumoto
761562b65f
freeze instance variables; ref #3340
2016-12-12 01:00:24 +09:00
Yukihiro "Matz" Matsumoto
92c843dd07
rename prefix RBASIC_ to MRB_; ref #3340
2016-12-12 00:54:36 +09:00
Yukihiro "Matz" Matsumoto
1fbad32f8b
Merge pull request #3340 from k0kubun/object-freeze
...
Implement Object#freeze
2016-12-12 00:49:23 +09:00
Kouhei Sutou
237d26fd86
Support pkg-config in mrbgem.rake
...
Example usage:
MRuby::Gem::Specification.new('mruby-onig-regexp') do |spec|
# ...
if spec.search_package('onigmo')
# Use onigmo.h when onigmo.pc exist.
spec.cc.defines += ["HAVE_ONIGMO_H"]
elsif spec.search_package('oniguruma')
# Use oniguruma.h when oniguruma.pc exist.
spec.cc.defines += ["HAVE_ONIGURUMA_H"]
else
# Use bundled Onigmo otherwise.
# ...
end
end
2016-12-11 21:35:56 +09:00
Takashi Kokubun
10bb7ad693
Implement Object#freeze
2016-12-11 03:44:15 +09:00
Yukihiro "Matz" Matsumoto
3cc913490b
Merge pull request #3329 from bouk/reuse
...
Mark all the built-in classes during GC sweep
2016-12-10 16:02:47 +09:00
Yukihiro "Matz" Matsumoto
d93422315c
Merge branch 'bouk-negate'
2016-12-10 15:55:45 +09:00
Yukihiro "Matz" Matsumoto
13979a4376
Merge pull request #3324 from bouk/mruby/bouk-negate
...
Don't generate code for NODE_NEGATE if the result isn't used
Reported by https://hackerone.com/haquaman
2016-12-10 15:52:41 +09:00
Yukihiro "Matz" Matsumoto
0af170fbec
gc.c: dead_slot is boolean; ref #3339
2016-12-10 15:34:32 +09:00
Yukihiro "Matz" Matsumoto
965690c94a
Merge pull request #3339 from kazuho/kazuho/retain-page-with-tt-env
...
do not destroy a page with an active TT_ENV
2016-12-10 15:32:55 +09:00
Kazuho Oku
2ef634edb5
do not destroy a page with an active TT_ENV (e.g. an env referred from TT_FIBER)
2016-12-10 15:11:07 +09:00
Yukihiro "Matz" Matsumoto
7b968ca893
Clear parsing_heredoc at the end of file
2016-12-10 12:35:12 +09:00
Yukihiro "Matz" Matsumoto
8c26efd7ed
Merge pull request #3338 from bouk/break-127
...
Fix segfault in gen_values with NOVAL and more than 127 args
2016-12-10 11:21:54 +09:00
Bouke van der Bijl
1264219832
Fix segfault in gen_values with NOVAL and more than 127 args
2016-12-09 10:30:05 -05:00
Yukihiro "Matz" Matsumoto
c85feaec56
Merge pull request #3337 from bouk/undef-127
...
Fix segfault when undef is called with more than 126 arguments
2016-12-09 16:42:54 +09:00
Bouke van der Bijl
c8da3c4df4
Fix segfault when undef is called with exactly 127 arguments
...
The issue is that when there are more than 126 arguments an array needs
to be created to pass the arguments on with.
Reported by https://hackerone.com/revskills
2016-12-08 15:47:17 -05:00
Yukihiro "Matz" Matsumoto
db6b6ff442
Merge pull request #3336 from AltimitSystems/string.const.macro
...
Removed unnecessary const macro - const keyword is already a dependency
2016-12-09 02:57:03 +09:00
Felix Jones
2827655b9c
Removed unnecessary const macro - const keyword is already a dependency
2016-12-08 12:38:00 +00:00
Yukihiro "Matz" Matsumoto
b84e005fc3
Merge pull request #3335 from mattn/fix-vs2013
...
fix build on vs2013-vs2015
2016-12-08 16:48:08 +09:00
Yasuhiro Matsumoto
c27dbfedf4
disable define const on VS
2016-12-08 15:56:50 +09:00
Yasuhiro Matsumoto
eda6c1dc05
fix build on vs2013-vs2015
2016-12-08 15:38:19 +09:00
Yukihiro "Matz" Matsumoto
bcd91856fd
Merge pull request #3331 from dabroz/feature-load-exec
...
Promote load_exec to mruby API as mrb_load_exec (fixes #3248 )
2016-12-08 15:22:07 +09:00
Yukihiro "Matz" Matsumoto
0d38ede33b
Merge pull request #3333 from kazuho/kazuho/mrb_gc_unregister
...
fix issues of mrb_gc_unregister introduced in 09b1185
2016-12-08 12:50:39 +09:00
Kazuho Oku
c2e749f878
fix issues of mrb_gc_unregister introduced in 09b1185
...
* fixes partial copy of objects in GC root array (due to missing `* sizeof(mrb_value)`)
* restores the behavior that permitted an unregistered object to be used as an argument
2016-12-08 10:27:07 +09:00
Tomasz Dąbrowski
0360a744b5
Promote load_exec to mruby API as mrb_load_exec ( fixes #3248 )
2016-12-07 21:21:21 +01:00
Bouke van der Bijl
d56a19cbf5
Don't generate code for NODE_NEGATE if the result isn't used
...
Reported by https://hackerone.com/haquaman
2016-12-07 15:14:17 -05:00
Bouke van der Bijl
f7a891fa89
Mark all the built-in classes during GC sweep
...
Reported by https://hackerone.com/haquaman
2016-12-07 15:14:12 -05:00
Yukihiro "Matz" Matsumoto
5930a6ebc7
Merge pull request #3328 from shugo/hash-dup-default_proc
...
Copy default_proc by Hash#dup.
2016-12-08 01:04:25 +09:00
Yukihiro "Matz" Matsumoto
edf26d4043
Merge pull request #3327 from AltimitSystems/errno.macro
...
Removed the errno declaration from string.c
2016-12-08 01:02:27 +09:00
Felix Jones
fe86cf4c91
Removed the errno declaration from string.c
2016-12-07 14:17:09 +00:00
Shugo Maeda
338e0ff52d
Copy default_proc by Hash#dup.
2016-12-07 22:39:20 +09:00
Felix Jones
6187c21bd9
Wrapped string.c errno with ifndef macro for platforms that use inbuilt errno macro
2016-12-07 12:46:47 +00:00
Yukihiro "Matz" Matsumoto
2b0dd1f481
Merge pull request #3325 from kazuho/kazuho/detect-64bit
...
set `MRB_64BIT` if the sizeof(size_t) is 8
2016-12-07 20:15:36 +09:00
Kazuho Oku
b491f4b06a
set MRB_64BIT if the sizeof(size_t) is 8
2016-12-07 15:31:32 +09:00
Yukihiro "Matz" Matsumoto
dffb4d82dc
Add type check for cls before allocation
2016-12-06 11:40:49 +09:00
Yukihiro "Matz" Matsumoto
3623a833a4
Protect exceptions within main() function
2016-12-06 11:23:23 +09:00
Yukihiro "Matz" Matsumoto
9a962ed2c3
Raise an exception in time_update_datetime().
...
The function used to return NULL on error, but not checked in the
caller site.
2016-12-06 10:27:35 +09:00
Yukihiro "Matz" Matsumoto
6ec14a2173
Merge pull request #3318 from bouk/splat-stack
...
Fix stack move segfaulting in OP_ARYCAT
2016-12-05 16:51:46 +09:00
Yukihiro "Matz" Matsumoto
43512cc7bd
Reorganize heredoc rules; fix #3273
...
The following codes used to be SyntaxError:
(1)
a = <<-EOD;
hello
EOD
(2)
<<-EOD.bla begin
k
EOD
end
2016-12-05 02:55:39 +09:00
Yukihiro "Matz" Matsumoto
ac561a52f5
Add symbol type check for Module#undef_method
2016-12-04 10:41:01 +09:00
Yukihiro "Matz" Matsumoto
5c651d6ce9
add MRB_API to mrb_float_read(); ref #3270
2016-12-03 18:55:52 +09:00
Yukihiro "Matz" Matsumoto
a0fbc46ccd
Import locale insensitive strtod() from Ruby1.8; fix #3270
...
The function was renamed to `mrb_float_read(const char*, char**)`.
2016-12-03 18:47:04 +09:00
Yukihiro "Matz" Matsumoto
802e396466
Merge branch 'bouk-method-missing-segfault'
2016-12-03 18:23:25 +09:00
Yukihiro "Matz" Matsumoto
144006a20e
update NoMethodError tests; ref #3291
2016-12-03 18:23:04 +09:00
Yukihiro "Matz" Matsumoto
8f510be211
Merge branch 'method-missing-segfault' of https://github.com/bouk/mruby into bouk-method-missing-segfault
2016-12-03 18:20:29 +09:00
Yukihiro "Matz" Matsumoto
f6d199919d
Needed to apply block from safe-navigation operators; fix #3310
2016-12-03 16:38:43 +09:00
Yukihiro "Matz" Matsumoto
6b84ff4a44
Print NODE_SCALL (&.) from mrb_parser_dump()
2016-12-03 16:21:15 +09:00
Yukihiro "Matz" Matsumoto
c029c6c444
codegen: avoid unnecessary OP_MOVE after CASE
2016-12-03 14:50:36 +09:00
Yukihiro "Matz" Matsumoto
23c4ad0865
Merge pull request #3319 from bouk/apost-splatt
...
Fix segfault when using result of rest assignment
2016-12-03 12:53:21 +09:00
Yukihiro "Matz" Matsumoto
79a621dd73
Check before retrieving struct RRange pointer; fix #3320
...
range->edges may be NULL for example when #initialize_copy removed.
2016-12-03 12:30:01 +09:00
Yukihiro "Matz" Matsumoto
9776150263
Merge pull request #3317 from bouk/missing-to-s
...
Use mrb_ptr instead of mrb_cptr in Kernel#to_s
2016-12-03 12:01:43 +09:00
Yukihiro "Matz" Matsumoto
d89cfca02c
Merge pull request #3315 from ksss/enumerator-with_index
...
Fix some incompatibility for Enumerator#with_index
2016-12-03 11:58:39 +09:00
Yukihiro "Matz" Matsumoto
e673fbb35a
Merge pull request #3321 from clayton-shopify/fix-proc-crash-upstream
...
Fix segfault in mrb_proc_copy.
2016-12-03 11:54:22 +09:00
Yukihiro "Matz" Matsumoto
d7589b10ed
Merge pull request #3316 from clayton-shopify/fix-array-size-3
...
Fix more integer overflows.
2016-12-03 11:52:52 +09:00
Clayton Smith
1ff4b3f800
Fix segfault in mrb_proc_copy.
2016-12-02 09:36:26 -05:00
Bouke van der Bijl
fe362c1f26
Fix segfault when using result of rest assignment
...
Reported by https://hackerone.com/haquaman
2016-12-01 15:49:36 -05:00
Bouke van der Bijl
9c61e1cd87
Use mrb_ptr instead of mrb_cptr in Kernel#to_s
...
This is to avoid segfault when WORD_BOXING is enabled
Reported by https://hackerone.com/brakhane
2016-12-01 15:23:56 -05:00
Bouke van der Bijl
7d07466b43
Fix stack move segfaulting in OP_ARYCAT
...
Reported by https://hackerone.com/haquaman
Testcase (couldn't get it to work as a test):
def nil.b
b *nil
end
nil.b
2016-12-01 15:23:31 -05:00
Clayton Smith
2bc3a5fb78
Fix more integer overflows.
2016-12-01 09:08:38 -05:00
Yukihiro "Matz" Matsumoto
2cca9d3688
avoid comparison between signed and unsigned integer; ref #3312
2016-12-01 18:49:39 +09:00
Yukihiro "Matz" Matsumoto
f1cf6ef817
Merge pull request #3312 from nobu/feature/multi-unicode-escape
...
Feature/multi unicode escape
2016-12-01 18:42:40 +09:00
Yukihiro "Matz" Matsumoto
4d807fc619
Merge pull request #3313 from yhara/add-test
...
Add test for recently fixed bugs
2016-12-01 18:41:23 +09:00
Yukihiro "Matz" Matsumoto
ab4ab7c8a0
Fix compile error by #3309
2016-12-01 18:37:03 +09:00
Nobuyoshi Nakada
0f08914ac0
Support multiple elements \u syntax
2016-12-01 16:48:43 +09:00
Nobuyoshi Nakada
fed40b44b8
Extract read_escape_unicode from read_escape
2016-12-01 16:48:43 +09:00
Nobuyoshi Nakada
bd9bc7786f
Fix assertion argument orders
2016-12-01 16:48:43 +09:00
Nobuyoshi Nakada
e4086d4014
Fix compile error by #3309
2016-12-01 16:46:59 +09:00
ksss
2718fed124
Support svalue
2016-12-01 16:13:24 +09:00
ksss
0f774ff4df
Support nil argument as no argument
2016-12-01 15:33:27 +09:00
Yutaka HARA
3f83ec64a8
Add test for recently fixed bugs
2016-12-01 14:55:26 +09:00
Yukihiro "Matz" Matsumoto
61ac564c99
Merge pull request #3309 from clayton-shopify/fix-array-size-2
...
Prevent array size calculation overflows.
2016-12-01 11:46:57 +09:00
Yukihiro "Matz" Matsumoto
c37c255f19
Merge pull request #3311 from ksss/enum-generator
...
Support Enumerable methods
2016-12-01 11:46:10 +09:00
ksss
31f0ffeac8
Support Enumerable methods
2016-12-01 10:42:57 +09:00
Clayton Smith
acdddb4f14
Prevent array size calculation overflows.
2016-11-30 13:55:09 -05:00
Yukihiro "Matz" Matsumoto
8461a31cb4
Fixed too much void_expr_error(); fix #3307
2016-11-30 13:04:50 +09:00
Yukihiro "Matz" Matsumoto
0e9c9acc11
Merge branch 'ksss-enumerator-lazy'
2016-11-30 12:54:29 +09:00
Yukihiro "Matz" Matsumoto
779c2629fe
resolve conflict; ref #3306
2016-11-30 12:54:20 +09:00
Yukihiro "Matz" Matsumoto
3cf66a8218
Merge pull request #3305 from ksss/lazy-to_enum
...
Implement Enumerable::Lazy#to_enum and enum_for
2016-11-30 12:48:28 +09:00
ksss
0f90227907
Change Lazy class outer
...
Lazy class should be under Enumerator instead of Enumerable
2016-11-30 12:36:22 +09:00
ksss
8675975ba2
Implement Enumerable::Lazy#to_enum and enum_for
2016-11-30 11:02:02 +09:00
Yukihiro "Matz" Matsumoto
2bb47addad
Prohibit instantiation of immediate objects
2016-11-30 10:36:17 +09:00
Yukihiro "Matz" Matsumoto
f7c0024b8e
Merge pull request #3278 from bouk/dup-class
...
Copy over INSTANCE_TT when duping class
2016-11-30 03:52:56 +09:00
Yukihiro "Matz" Matsumoto
5771c9778e
add a test for #3296
2016-11-30 03:51:23 +09:00
Yukihiro "Matz" Matsumoto
37743111d9
should not refer Struct class by name; fix #3296
2016-11-30 03:49:56 +09:00
Yukihiro "Matz" Matsumoto
630733f346
check ttype before object allocation; fix #3294
2016-11-30 03:38:55 +09:00
Yukihiro "Matz" Matsumoto
27d166d4e2
Merge pull request #3304 from clayton-shopify/fix-array-size
...
Use size_t to calculate bytes needed for array.
2016-11-30 03:00:43 +09:00
Yukihiro "Matz" Matsumoto
66f64d4ee8
Merge pull request #3303 from bouk/empty-nil
...
Interpret argument in 'f ()' as nil instead of nothing
2016-11-30 02:52:39 +09:00
Clayton Smith
b633aa9ad4
Use size_t to calculate bytes needed for array.
2016-11-29 10:26:02 -05:00
Bouke van der Bijl
523c267020
Interpret argument in 'f ()' as nil instead of nothing
2016-11-29 09:23:53 -05:00
Yukihiro "Matz" Matsumoto
246a9a8acd
ary_concat: support self concatenation; fix #3302
2016-11-29 22:36:11 +09:00
Yukihiro "Matz" Matsumoto
9fc62d28d0
pre-allocate arena overflow error
2016-11-28 09:52:57 +09:00
Yukihiro "Matz" Matsumoto
27ceb84818
parse.y: use opt_paren_args to simplify yield rule
2016-11-27 22:43:46 +09:00
Yukihiro "Matz" Matsumoto
36fc1f1431
Added Exception check in mrb_exc_set(); close #3292
...
PR #3293 just checks for NoMethodError.
2016-11-27 22:17:51 +09:00
Yukihiro "Matz" Matsumoto
5ea1bb0eea
Merge pull request #3301 from dabroz/feature-64-bit-word
...
Safeguard against using MRB_INT64 with MRB_WORD_BOXING in 32-bit mode
2016-11-27 21:00:34 +09:00
Yukihiro "Matz" Matsumoto
f9f19f34dd
replace _cstr by _lit for litral C strings; ref #3300
2016-11-27 20:53:25 +09:00
Tomasz Dabrowski
3fdfd8cb4a
Safeguard against using MRB_INT64 with MRB_WORD_BOXING in 32-bit mode
2016-11-27 12:49:36 +01:00
Yukihiro "Matz" Matsumoto
3d9aa463f7
Add NULL checks for Time data retrieval
2016-11-27 20:47:20 +09:00
Yukihiro "Matz" Matsumoto
c70e206330
Merge pull request #3300 from herwinw/doc
...
Added documentation on function for globals
2016-11-27 20:46:58 +09:00
Herwin Weststrate
afee618c1b
Added documentation on function for globals
2016-11-27 09:50:30 +01:00
Yukihiro "Matz" Matsumoto
72915cab52
Merge pull request #3299 from dabroz/feature-16-bit-nan
...
Fixed NaN boxing when MRB_INT16 is set
2016-11-27 09:27:03 +09:00
Tomasz Dąbrowski
626648dc41
Fixed NaN boxing when MRB_INT16 is set
2016-11-26 13:05:02 +01:00
Yukihiro "Matz" Matsumoto
277e81a7c9
removed failing test for Time#initialize; ref #3295
2016-11-26 12:02:46 +09:00
Yukihiro "Matz" Matsumoto
4256130ecd
Merge pull request #3293 from ksss/enum-first
...
Fix incompatibility for Enumerable#first
2016-11-26 09:59:50 +09:00
Yukihiro "Matz" Matsumoto
f666350694
Merge pull request #3295 from bouk/time-seg
...
Fix null pointer dereference in mrb_time_initialize
2016-11-26 09:57:48 +09:00
Yukihiro "Matz" Matsumoto
0ee58a0fff
Merge pull request #3298 from dabroz/patch-1
...
Fix typo in istruct.h
2016-11-26 09:50:37 +09:00
Tomasz Dąbrowski
be5223371b
Fix typo in istruct.h
2016-11-25 23:15:37 +01:00
Bouke van der Bijl
b7f9a58757
Fix null pointer dereference in mrb_time_initialize
...
Reported by https://hackerone.com/raydot
2016-11-25 11:15:57 -05:00
ksss
1bf565ea04
Argument more strictly
2016-11-25 22:25:48 +09:00
ksss
c28a963bf4
Like a Enumerable#take
2016-11-25 22:20:33 +09:00
Yukihiro "Matz" Matsumoto
743c1e7be1
stop warnings in the test; ref #3280
2016-11-25 09:44:22 +09:00
Yukihiro "Matz" Matsumoto
1329529f3b
Merge branch 'bouk-nested-empty-heredoc'
2016-11-25 09:33:40 +09:00
Yukihiro "Matz" Matsumoto
55842c5a34
resolve conflict; ref #3279
2016-11-25 09:33:20 +09:00
Yukihiro "Matz" Matsumoto
d3ff9d31f0
Merge branch 'bouk-struct-array-members'
2016-11-25 09:32:01 +09:00
Yukihiro "Matz" Matsumoto
79e3980a7f
resolve conflict; ref #3281
2016-11-25 09:31:51 +09:00
Yukihiro "Matz" Matsumoto
7f05ba86f2
Merge branch 'bouk-127-segfaults'
2016-11-25 09:27:32 +09:00
Yukihiro "Matz" Matsumoto
30f12ba4bc
resolve conflict; ref #3283
2016-11-25 09:27:24 +09:00
Yukihiro "Matz" Matsumoto
9f7701e27a
Merge branch 'bouk-retry-codegen-misalign'
2016-11-25 09:26:01 +09:00
Yukihiro "Matz" Matsumoto
cc2786c84e
resolve conflict; ref #3285
2016-11-25 09:25:51 +09:00
Yukihiro "Matz" Matsumoto
0d48a9786f
Merge branch 'bouk-empty-ternary'
2016-11-25 09:24:09 +09:00
Yukihiro "Matz" Matsumoto
0b4017fd69
resolve conflict; ref #3286
2016-11-25 09:23:47 +09:00
Yukihiro "Matz" Matsumoto
d77b254108
Merge pull request #3287 from bouk/proc-arity
...
Fix calling .arity on Proc with undefined `initialize`
2016-11-25 09:20:47 +09:00
Yukihiro "Matz" Matsumoto
6905597f5b
Merge pull request #3284 from bouk/remove-method-segfault
...
Fix segfault on remove_method with invalid argument
2016-11-25 09:19:22 +09:00
Yukihiro "Matz" Matsumoto
a28fa35ea9
Merge pull request #3282 from bouk/fix-break-instance-class
...
Fix segfault when defining class inside instance_exec on primitive
2016-11-25 09:17:59 +09:00
Yukihiro "Matz" Matsumoto
1e892c0ffa
Merge pull request #3280 from bouk/struct-redefine
...
Remove constant when a struct is redefined.
2016-11-25 09:15:57 +09:00
Yukihiro "Matz" Matsumoto
b4d501750c
Merge pull request #3288 from bouk/chomp-bang-len
...
Get String length after args in String#chomp!
2016-11-25 08:01:41 +09:00
Yukihiro "Matz" Matsumoto
54921aa671
Merge pull request #3289 from bouk/setbyte-len
...
Read length after args in String#setbyte
2016-11-25 08:01:06 +09:00
Yukihiro "Matz" Matsumoto
99f6de529e
Merge pull request #3290 from bouk/unsafe-peep
...
Fix unsafe peephole optimization
2016-11-25 08:00:33 +09:00
Francois Chagnon
a384bcce35
Fix instances where return value of mrb_method_search_vm is unchecked
...
Reported by @charliesome
2016-11-24 10:51:29 -05:00
Francis Bogsanyi
964427f82c
Fix unsafe peephole optimization
...
Reported by https://hackerone.com/dkasak
2016-11-24 10:32:34 -05:00
Craig Lehmann
83005d83d8
Read length after args in String#setbyte
...
Prevents RCE
Reported by https://hackerone.com/raydot
2016-11-24 10:31:29 -05:00
Clayton Smith
76a1bdfa29
Get String length after args in String#chomp!
...
Fixes RCE issue
Reported by @bouk
2016-11-24 10:28:21 -05:00
Francois Chagnon
1ec5994377
Fix calling .arity on Proc with undefined initialize
...
Reported by @bouk
2016-11-24 10:23:31 -05:00
Bouke van der Bijl
71641bbf73
Fix segfault caused by empty condition in ternary
...
Reported by https://hackerone.com/jpenalbae
2016-11-24 10:20:42 -05:00
Bouke van der Bijl
1253982577
Fix codegen issue causing misaligned register
...
Reported by https://hackerone.com/haquaman
2016-11-24 10:18:48 -05:00
Bouke van der Bijl
22f5504054
Fix segfault on remove_method with invalid argument
...
Reported by https://hackerone.com/jpenalbae
2016-11-24 10:13:47 -05:00
Bouke van der Bijl
75b31d7438
Fix segfault on method call with exactly 127 arguments
...
Reported by https://hackerone.com/dkasak
2016-11-24 10:09:37 -05:00
Bouke van der Bijl
4523aaec01
Fix segfault when defining class inside instance_exec on primitive
2016-11-24 10:06:15 -05:00
Clayton Smith
b60d6c42aa
Don't allow array parameter in Struct.new
2016-11-24 10:05:05 -05:00
Clayton Smith
82731d9ee0
Remove constant when a struct is redefined.
2016-11-24 10:04:09 -05:00
Bouke van der Bijl
73e4f069be
Fix nested empty heredoc causing segfault
...
As reported by https://hackerone.com/jpenalbae
2016-11-24 09:54:18 -05:00
Bouke van der Bijl
73bb30c2f4
Copy over INSTANCE_TT when duping class
2016-11-24 09:52:30 -05:00
Yukihiro "Matz" Matsumoto
a630c4f413
use MRB_PRId instead of %d for mrb_int
2016-11-24 22:10:54 +09:00
Yukihiro "Matz" Matsumoto
8602789067
Merge pull request #3277 from dabroz/feature-float-tolerance
...
Fixed float tolerance in tests when MRB_USE_FLOAT is set
2016-11-24 21:48:14 +09:00
Yukihiro "Matz" Matsumoto
e289ba3eff
Merge pull request #3276 from dabroz/author
...
Update AUTHORS
2016-11-24 21:28:55 +09:00
Yukihiro "Matz" Matsumoto
22f73250db
redo should work well in for statement; fix #3275
2016-11-24 21:25:27 +09:00
Tomasz Dąbrowski
72ed7eebc3
Fixed Range.size to use proper floating point tolerance
2016-11-24 12:50:49 +01:00
Tomasz Dąbrowski
a8b8abbd82
Fixed float tolerance in tests when MRB_USE_FLOAT is set
2016-11-24 12:48:41 +01:00
Tomasz Dąbrowski
3943ab5368
Update AUTHORS
2016-11-24 12:34:36 +01:00
Yukihiro "Matz" Matsumoto
0c924b9287
fixed a bug in self modifying Array#[]=; fix #3274
2016-11-24 19:30:21 +09:00
Yukihiro "Matz" Matsumoto
cb5c9d3415
always call Hash#default if no key found; fix #3272
2016-11-24 18:09:04 +09:00
Yukihiro "Matz" Matsumoto
23c73ff399
Time#initialize_copy: Check if source time is initialized.
...
To prevent crash from nasty code like:
class Time
def initialize
end
end
a = Time.new
b = Time.new
a.initialize_copy b
2016-11-24 13:50:36 +09:00
Yukihiro "Matz" Matsumoto
cef7bd5416
Merge pull request #3271 from ksss/enum-take
...
Fix Enumeable#take some incompatibility
2016-11-24 11:31:28 +09:00
Yukihiro "Matz" Matsumoto
227daa8811
Relax 'void value expression' check that was too strict
2016-11-24 11:22:54 +09:00
ksss
5134734541
Shouldn't call each method if size is 0
2016-11-24 10:35:15 +09:00
ksss
9e2faec8e4
Support object does'n have < method
2016-11-24 10:34:14 +09:00
Yukihiro "Matz" Matsumoto
1c9593954b
Add "void value expression" check to the parser.
2016-11-24 10:32:28 +09:00
Yukihiro "Matz" Matsumoto
dc4be19aab
Add forgotten loop_pop() in NODE_OP_ASGN codegen
2016-11-24 10:01:03 +09:00
Yukihiro "Matz" Matsumoto
f5a86ca530
Add pointer casting from mrb_malloc(); ref #3267
2016-11-24 09:28:00 +09:00
Yukihiro "Matz" Matsumoto
798c69d1be
Avoid casting from int to unsigned char for C++; ref #3267
2016-11-24 09:28:00 +09:00
Tomasz Dąbrowski
d7a6070d22
Fixed language standard mode for GCC (cannot use gnu99 with C++, c++03 used instead)
2016-11-24 09:28:00 +09:00
Tomasz Dąbrowski
c2a60eb8af
Fix for Windows-specific mruby C++ issues
2016-11-24 09:28:00 +09:00
Tomasz Dąbrowski
44c3859a97
Fix for compiling mruby as C++ on Visual Studio toolchain
2016-11-24 09:28:00 +09:00
Tomasz Dąbrowski
18757c8f7b
Different method of compiling C as C++ (-x c++)
2016-11-24 09:28:00 +09:00
Tomasz Dąbrowski
00e6121260
Safeguard against trying to use C++ exception handling in C code
2016-11-24 09:28:00 +09:00
Tomasz Dąbrowski
401ad4586f
Add constant export declaration for MRBC output compiled as C++
...
Otherwise, C++ compilers will skip this constant when producing object files.
2016-11-24 09:28:00 +09:00
Tomasz Dąbrowski
1af9e363f2
Fixes for compiling mruby as C++
2016-11-24 09:28:00 +09:00
Yukihiro "Matz" Matsumoto
477e12c182
Merge pull request #3269 from bouk/fix-printf-segfault
...
Fix segfault when Fixnum#chr doesn't return a string
2016-11-24 09:16:43 +09:00
Yukihiro "Matz" Matsumoto
2c28d00356
Merge pull request #3268 from bouk/fix-random-segfault
...
Fix segfault in Array#sample
2016-11-24 09:13:34 +09:00
Bouke van der Bijl
9bf1c0e1dc
Fix segfault when Fixnum#chr doesn't return a string
2016-11-23 15:18:52 -05:00
Bouke van der Bijl
c7262be0ae
Fix segfault in Array#sample
2016-11-23 11:21:14 -05:00
Yukihiro "Matz" Matsumoto
669bbc70b0
codegen_scope should not keep old iseq ptr from irep
2016-11-23 21:08:35 +09:00
Yukihiro "Matz" Matsumoto
bfbc6b9ea4
local_variables() should not touch unshared env
2016-11-23 20:50:14 +09:00
Yukihiro "Matz" Matsumoto
efebbbbf26
Implement Float shift methods in C
2016-11-23 09:45:50 +09:00
Yukihiro "Matz" Matsumoto
f414ed03d6
Merge pull request #3265 from dabroz/feature-fixexternc
...
Fixed C declaration in re.h
2016-11-22 22:22:47 +09:00
Tomasz Dąbrowski
52b40cb4d0
Fixed extern "C" to use MRB_BEGIN/END_DECL in re.h
2016-11-22 13:34:40 +01:00
Yukihiro "Matz" Matsumoto
8cba708854
int64_value(): use FIXABLE()
2016-11-22 19:11:54 +09:00
Yukihiro "Matz" Matsumoto
fb7776586e
hash value may be overflown from Integer
...
mruby special.
2016-11-22 18:00:04 +09:00
Yukihiro "Matz" Matsumoto
be73905c9c
accept floats as bit operator operands; fix #3260
2016-11-22 17:59:41 +09:00
Yukihiro "Matz" Matsumoto
8112295031
Removed fix_shift_get_width()
...
Fixnum is usually big enough for shift width.
2016-11-22 17:45:07 +09:00
Yukihiro "Matz" Matsumoto
740bf09740
add bit operators ~,&,|,^ to Float class (mruby special)
2016-11-22 17:36:26 +09:00
Yukihiro "Matz" Matsumoto
a70104798e
remove unnecessary ".!"; ref #3261
2016-11-22 16:55:18 +09:00
Yukihiro "Matz" Matsumoto
bbaf3c242d
Merge pull request #3261 from ksss/range-first
...
Reimplements Range#first
2016-11-22 16:38:24 +09:00
Yukihiro "Matz" Matsumoto
03e399accf
Merge pull request #3262 from dabroz/feature-nanbox64fix
...
Fixed NaN boxing for 64-bit configrations
2016-11-22 16:36:43 +09:00
Yukihiro "Matz" Matsumoto
de415b7bc0
Merge pull request #3264 from naclyhara/patch-1
...
Fix typo in test
2016-11-22 16:34:45 +09:00
Yutaka HARA
aaa86a1fd5
Fix typo in test
2016-11-22 16:25:18 +09:00
Tomasz Dąbrowski
b21b02465e
asserts checking validity of pointer and TT added for mrb_obj_value
...
Useful for testing when using boxing on different platforms.
2016-11-21 12:37:45 +01:00
Tomasz Dąbrowski
c385782cfe
mrb_assert definition moved to the beggining of mruby.h
...
So that other files can immediately use it.
2016-11-21 12:37:45 +01:00
Tomasz Dąbrowski
8cdaf1ed35
Fixed NaN boxing for 64-bit configrations on platforms that use full 48-bit usermode pointers
...
Definition of boxed pointer is following:
`111111111111TTTT TTPPPPPPPPPPPPPP PPPPPPPPPPPPPPPP PPPPPPPPPPPPPPPP`
Previously, only the last 32-bit were set, and remaining 14 bits were zeroed when setting `ttt`.
2016-11-21 12:37:45 +01:00
Tomasz Dąbrowski
d86f5d2dca
mruby architecture detection
2016-11-21 12:37:45 +01:00
ksss
682237be6e
Reimplements Range#first
...
Range#first shouldn't call `Range#to_a` on infinity range.
2016-11-21 16:55:49 +09:00
Yukihiro "Matz" Matsumoto
a3f8206ce6
Merge pull request #3259 from dabroz/feature-16bitfix1
...
Fix for sprintf test exceeding bounds with MRB_INT16
2016-11-21 10:22:47 +09:00
Tomasz Dąbrowski
4289e0cd81
Fix for sprintf test exceeding bounds with MRB_INT16
2016-11-21 00:37:03 +01:00
Yukihiro "Matz" Matsumoto
3ce51cbc7c
Merge pull request #3257 from ksss/range-size
...
Fix Range#size results
2016-11-21 01:15:37 +09:00
ksss
22390aa1c8
Use mrb_float instead of double
2016-11-19 23:25:08 +09:00
ksss
a2fbd80a47
Fix Range#size results
2016-11-19 23:25:07 +09:00
Yukihiro "Matz" Matsumoto
0ff3ae1fba
Range#include?: simplify condition; ref #3255
2016-11-18 11:54:24 +09:00
Yukihiro "Matz" Matsumoto
b03b1e37d9
Merge pull request #3255 from ksss/range-include
...
Fix condition of Range#include?
2016-11-18 11:48:49 +09:00
ksss
4ef591c897
Fix condition of Range#include?
2016-11-18 10:01:03 +09:00
Yukihiro "Matz" Matsumoto
2a38bf9116
Merge pull request #3254 from herwinw/doc
...
Doc
2016-11-18 00:02:58 +09:00
Herwin Weststrate
18d6994f78
Documented most methods in mruby/hash.h
2016-11-17 11:52:28 +01:00
Herwin Weststrate
d20c56c7fa
Documented most methods in mruby/array.h
2016-11-17 11:41:49 +01:00
Herwin Weststrate
c043dc631e
Typo fix: poped => popped
2016-11-17 11:05:27 +01:00
Yukihiro "Matz" Matsumoto
57900d809f
String#include? does not take integers
2016-11-17 18:02:10 +09:00
Yukihiro "Matz" Matsumoto
92be276d76
String#{strip,lstrip,rstrip} may cause OOB access
2016-11-17 18:00:21 +09:00
Yukihiro "Matz" Matsumoto
2e8ed9514f
Removed mruby-inline-struct gem from default.gembox; ref #3251
...
bundled testing gems do not need to be included in default.gembox.
all gems under mrbgems are linked automatically in the test process.
2016-11-17 17:19:49 +09:00
Yukihiro "Matz" Matsumoto
8438792d27
renamed "inline" to "istruct" to represent inline struct; ref #3251
2016-11-17 17:19:49 +09:00
Tomasz Dąbrowski
4cca8bac6b
inline structures data type for mruby (MRB_TT_INLINE) ( fix #3237 )
...
Inline structures have no instance variables, no finalizer, and offer as much space as possible in RBASIC object. This means 24 bytes on 64-bit platforms and 12 bytes on 32-bit platforms.
mruby-inline-struct gem is only provided for testing.
2016-11-17 17:19:49 +09:00
Yukihiro "Matz" Matsumoto
784e07f902
Merge pull request #3252 from BanzaiMan/patch-1
...
Remove webhook notification for Travis CI
2016-11-17 16:46:26 +09:00
Yukihiro "Matz" Matsumoto
c8b028027f
Merge pull request #3253 from ksss/range
...
Ranges should not rewrite
2016-11-17 16:44:58 +09:00
ksss
176d93d72a
Ranges should not rewrite
2016-11-17 14:57:30 +09:00
Hiro Asari
1ba61f055c
Remove webhook notification for Travis CI
...
As travis-rubies now uses 3 Mac jobs to create archives for various OS
releases.
This is a bit wasteful if multiple builds pass in a short period.
Instead, Travis CI is now running a nightly build of mruby-head
(around 22:30 UTC). This will happen regardless of the state of the
master branch.
2016-11-16 19:41:40 -05:00
Yukihiro "Matz" Matsumoto
5208ee534f
Merge pull request #3250 from dabroz/feature-correct-aspec
...
Correct argument specifications for few methods
2016-11-17 00:41:54 +09:00
Tomasz Dąbrowski
8e0dc6fa8d
Correct argument specifications for few methods:
...
- Struct#values_at
- Module#define_method
- String#chop
- String#chop!
2016-11-16 15:46:28 +01:00
Yukihiro "Matz" Matsumoto
1685eff2a5
Fixed off-by-one error in String#[]= with Ranges
2016-11-16 10:16:14 +09:00
Yukihiro "Matz" Matsumoto
1f554ff854
Fixed rindex calling into mrb_equal bug
...
Fixed by Alex Snaps and reported by Mathieu Leduc-Hamel,
both from shopify.com. Thank you!
2016-11-16 02:10:44 +09:00
Yukihiro "Matz" Matsumoto
242b219471
Fixed memory disclosure in String#lines
...
Reported from from Alex Snaps via Mathieu Leduc-Hamel,
both from shopify.com. Thank you!
2016-11-16 02:05:19 +09:00
Yukihiro "Matz" Matsumoto
92f72c7490
make String#[]= to take Ranges as position argument
2016-11-16 02:04:56 +09:00
Yukihiro "Matz" Matsumoto
739dad6e87
Fixed a memory problem in Array#to_h
...
Reported from Alex Snaps via Mathieu Leduc-Hamel,
both from shopify.com. Thank you!
2016-11-16 01:29:04 +09:00
Yukihiro "Matz" Matsumoto
4f6cce059b
class/module statement should re-open; fix #3225
2016-11-15 04:15:24 +09:00
Yukihiro "Matz" Matsumoto
1422e57630
move mrb_str_dup() to mrb_class_path; ref #2470
...
Class#to_s used to return same string repeatedly,
that mean you can modify "class name" by modifying
the return value from Class#to_s.
2016-11-13 16:17:44 +09:00
Yukihiro "Matz" Matsumoto
01dddaf385
rename mruby-module-ext to mruby-class-ext; ref #2470
2016-11-13 16:17:44 +09:00
take_cheeze
451985d44b
Implement Module#name.
...
Solves #2132 .
2016-11-13 16:17:36 +09:00
Yukihiro "Matz" Matsumoto
88604e39ac
Hash#[] to call Hash#default
2016-11-12 05:23:05 +09:00
Yukihiro "Matz" Matsumoto
feb9b3debd
Merge pull request #3224 from ksss/define_method
...
Module#define_method supports proc argument
2016-11-11 22:57:52 +09:00
Yukihiro "Matz" Matsumoto
752ca514f6
do not dump_node if parser failed
2016-11-11 22:51:48 +09:00
Yukihiro "Matz" Matsumoto
185dad3a6e
node_dump() to print NODE_HEREDOC terminator
2016-11-11 22:50:41 +09:00
Yukihiro "Matz" Matsumoto
45aadd7e60
HEREDOC could fail with NUL terminated lines; fix#3244
2016-11-11 22:49:23 +09:00
Yukihiro "Matz" Matsumoto
e86ead436a
Merge pull request #3246 from ksss/cycle
...
Reimplement Enumerable#cycle
2016-11-11 20:43:22 +09:00
ksss
7685783af4
Add regression test for Enumerable#cycle
2016-11-11 16:53:42 +09:00
ksss
126d55480d
Reimplement Enumerable#cycle
...
Fix pattern of infinite loop
And support all specs in https://github.com/ruby/spec/blob/27960d06e0ce92c37f074450f0eab4b0519b118c/core/enumerable/cycle_spec.rb without Enumerable#size
2016-11-11 16:53:42 +09:00
Yukihiro "Matz" Matsumoto
3d946a8044
Merge pull request #3240 from dabroz/feature-fixtest
...
test/assert.rb should not use puts
2016-11-11 13:36:53 +09:00
Yukihiro "Matz" Matsumoto
570cbbdf3d
Merge pull request #3234 from AltimitSystems/mrb.class_under_defined
...
Add mrb_class_defined_under
2016-11-11 08:24:52 +09:00
Felix Jones
70aa6dc38d
Merge branch 'master' into android.rake-ndk-clang
2016-11-10 20:01:59 +00:00
Felix Jones
178816626d
Merge branch 'mrb.class_under_defined'
2016-11-10 19:52:27 +00:00
Felix Jones
e3c8092ccd
Renamed class_under_defined to class_defined_under
2016-11-10 19:51:56 +00:00
Yukihiro "Matz" Matsumoto
3f002b6993
fixed a bug when number of LHS and RHS differs; fix #3239
2016-11-11 04:37:42 +09:00
Tomasz Dąbrowski
617050450e
test/assert.rb should not use puts
2016-11-10 13:17:59 +01:00
Yukihiro "Matz" Matsumoto
872517dff3
class variables in higher order have a priority; fix #3235
2016-11-08 23:51:15 +09:00
Yukihiro "Matz" Matsumoto
1142cf2037
fixed a bug with [] in RHS of multiple assignments; fix #3236
2016-11-08 22:18:41 +09:00
Yukihiro "Matz" Matsumoto
6c299aae67
fixed wrong stack adjustment for ensure clauses; fix #3175
2016-11-07 00:44:08 +09:00
Felix Jones
cc5f40b2db
mrb_class_under_defined docs renamed parent and child to outer and inner
2016-11-06 13:19:14 +00:00
Felix Jones
8d6aa06548
Added mrb_class_under_defined
2016-11-06 13:01:21 +00:00
Yukihiro "Matz" Matsumoto
0b8d8dd379
associate REnv to the executing block; fix #3214
2016-11-05 02:52:34 +09:00
Yukihiro "Matz" Matsumoto
46995c3264
add quoted symbol tests; ref #3231
2016-11-04 14:21:46 +09:00
Yukihiro "Matz" Matsumoto
2960c69435
Merge pull request #3232 from lukaselmer/patch-1
...
Update documentation of fetch
2016-11-03 13:39:24 +09:00
Lukas Elmer
f02694ecc7
Update documentation of fetch
...
The sentence `Negative values of +index+ count from the end of the array.` can be interpreted that it only holds if a block is given. Clarify it.
2016-11-02 19:45:43 +01:00
Yukihiro "Matz" Matsumoto
cc3f1b7f5c
allow single quoted labels in hashes; ref #3231
2016-11-02 16:14:20 +09:00
Yukihiro "Matz" Matsumoto
13d0832965
allow quoted labels in hashes; fix #3231
2016-11-02 08:41:43 +09:00
Yukihiro "Matz" Matsumoto
9a126278b6
should not unshare() reclaimed env objects; fix #3230
2016-10-28 09:21:14 +09:00
Yukihiro "Matz" Matsumoto
c45ed46f28
macro mrb_bool() may evaluate arg multiple times; ref #3228
2016-10-24 01:30:31 +09:00
Yukihiro "Matz" Matsumoto
7061658b5b
Merge pull request #3228 from ksss/respond_to_missing
...
Kernel#respond_to? should return true|false only
2016-10-24 01:27:13 +09:00
ksss
022e147b78
Kernel#respond_to? should return true|false only
2016-10-23 18:25:47 +09:00
Yukihiro "Matz" Matsumoto
6fd0e601cf
Move to_proc conversion from OP_ENTER to OP_SENDB; fix #3227
2016-10-20 23:49:40 +09:00
ksss
efe4f30b39
Module#define_method supports proc argument
2016-10-12 22:19:54 +09:00
Yukihiro "Matz" Matsumoto
8488425e50
Merge pull request #3223 from AltimitSystems/android.rake-ndk-clang
...
Android Task GCC support re-added
2016-10-08 23:34:48 +09:00
Felix Jones
c3f271a861
Merge branch 'master' of github.com:mruby/mruby
2016-10-08 15:12:45 +01:00
Felix Jones
b83bcd12df
Removed GCC TODO
2016-10-08 15:10:46 +01:00
Felix Jones
3e9fe81591
Android GCC support re-added
2016-10-08 15:09:08 +01:00
Yukihiro "Matz" Matsumoto
364761f473
Merge pull request #3222 from AltimitSystems/android.rake-ndk-clang
...
Android mips/mips64 support
2016-10-08 10:33:54 +09:00
Felix Jones
5d2795c00d
Fixed mips and mips64: GCC Toolchain now points to GCC.
2016-10-08 00:23:55 +01:00
Felix Jones
5fd068eb4d
Android task: NDK default search paths now favour ndk-bundle. Added macOS NDK search paths.
2016-10-07 22:31:24 +01:00
Yukihiro "Matz" Matsumoto
2d335daeeb
Merge pull request #3218 from nobu/trailing-space
...
Removed trailing spaces
2016-09-28 15:51:02 +09:00
Nobuyoshi Nakada
6511bfd79a
Removed trailing spaces
2016-09-28 12:29:41 +09:00
Yukihiro "Matz" Matsumoto
9d3167cabe
Merge pull request #3217 from ksss/break
...
Fix unexpected behavior with break
2016-09-27 10:31:48 +09:00
Yukihiro "Matz" Matsumoto
afbe211c60
mrb_str_strlen() should be MRB_API; ref #3216
2016-09-27 10:29:56 +09:00
Yukihiro "Matz" Matsumoto
6bc4b47c46
Merge pull request #3216 from kou/remove-needless-mrbapi
...
Remove needless MRB_API
2016-09-27 10:28:04 +09:00
ksss
b1fa180ea3
Fix unexpected behavior with break
...
```
def yie
yield
end
def bre
yie {
1+1
break
}
end
p bre #=> display 2, but should be nil
```
2016-09-26 12:17:46 +09:00
Kouhei Sutou
91bd3ebd32
Remove needless MRB_API
...
ref #3215
If a function (such as mrb_read_irep_file()) is declared without MRB_API
in header file (such as include/mruby/dump.h), implementation of the
function in source file (such as src/load.c) should also defined without
MRB_API.
If MRB_API is mismatch, Visual C++ reports link error with C2375 error
code: https://msdn.microsoft.com/en-us/library/5k6kw95a.aspx
2016-09-25 21:47:49 +09:00
Yukihiro "Matz" Matsumoto
7a382e8bdf
Remove unnecessary MRB_API from read_irep related functions; ref #3215
2016-09-24 05:26:51 +09:00
Yukihiro "Matz" Matsumoto
77d004e835
Merge pull request #3213 from unak/print-visualc
...
Visual C++ support of UTF-8 hack on mruby-print
2016-09-22 00:41:04 +09:00
U.Nakamura
36c08476d9
Use non-underscore'ed names
...
Accept @mattn's comment.
2016-09-21 14:39:08 +09:00
U.Nakamura
37d2d57d63
Use underbar'ed name to get rid of warnings
2016-09-21 12:59:36 +09:00
U.Nakamura
e5fedaf67f
Not only for MINGW but also for Visual C++
2016-09-21 12:58:58 +09:00
Kazuaki Tanaka
cb29c9b415
Fix return value type of bytecode_decoder
2016-09-20 23:15:49 +00:00
Kazuaki Tanaka
968ebac001
Bytecode decoder support, MRB_BYTECODE_DECODE_OPTION
2016-09-20 23:07:28 +00:00
Yukihiro "Matz" Matsumoto
c698c67e10
Merge pull request #3211 from eregon/fix_limitation_typos
...
Fix a couple typos in limitations.md
2016-09-18 08:58:51 +09:00
Benoit Daloze
5f37d8bd89
Fix a couple typos in limitations.md
2016-09-17 23:14:55 +02:00
Yukihiro "Matz" Matsumoto
6498970d81
Merge pull request #3210 from AltimitSystems/android.rake-ndk-clang
...
Fixed regex order falling early in arch cases, causing x86_64 and arm…
2016-09-16 08:33:01 +09:00
Felix Jones
04ae2960f4
Fixed regex order falling early in arch cases, causing x86_64 and arm-v7a to use wrong target.
2016-09-15 18:14:27 +01:00
Yukihiro "Matz" Matsumoto
07e905ef02
Merge pull request #3209 from AltimitSystems/master
...
Re-written android.rake task for latest Android NDK clang. Currently …
2016-09-16 00:33:50 +09:00
Felix Jones
18662ff576
Re-written android.rake task for latest Android NDK clang. Currently loses support for GCC and mips, mips64. Addresses issue #3208
2016-09-15 15:57:44 +01:00
Yukihiro "Matz" Matsumoto
08a1dd2ac8
Merge pull request #3207 from ksss/splat
...
Fix SEGV when splat object
2016-09-08 21:13:12 +09:00
ksss
d467022347
Add testing for regression
2016-09-08 16:35:41 +09:00
ksss
d265c03da0
Fix SEGV when splat object
...
Splat operation should return an array.
And raise an error if result of convert by to_a is not array or nil.
2016-09-08 16:35:17 +09:00
Yukihiro "Matz" Matsumoto
cd5133c570
Merge pull request #3205 from yurie/abort-header
...
surpress warning when MRB_DISABLE_STDIO
2016-09-06 23:14:25 +09:00
Yukihiro "Matz" Matsumoto
028dcfe881
Merge pull request #3206 from ksss/env
...
Fix SEGV when unshared env
2016-09-06 23:13:58 +09:00
yuri
c9d4d96872
surpress warning when MRB_DISABLE_STDIO
2016-09-06 22:41:50 +09:00
ksss
e66b35c6ee
Fix SEGV when unshared env
2016-09-06 17:11:18 +09:00
Yukihiro "Matz" Matsumoto
9040086e92
Merge pull request #3204 from ksss/mid
...
Should clear method name
2016-09-05 22:36:19 +09:00
ksss
a5c2e95b10
Should clear method name
...
- Fix method name in top-level
- Fix SEGV when call Exception#backtrace if callinfo over CALLINFO_INIT_SIZE(32)
2016-09-05 21:58:08 +09:00
Yukihiro "Matz" Matsumoto
d58c2585d4
Merge pull request #3202 from pbosetti/master
...
In mrbgem_spec.rake, added support for @mrblib_dir @objs_dir, so that a gem can have custom source directory names
2016-09-05 13:06:40 +09:00
Yukihiro "Matz" Matsumoto
495545ab09
Merge pull request #3203 from nozomiS/mrbc_filename-fix
...
Fix mrbc_filename leak
2016-09-05 13:02:32 +09:00
Nozomi SATO
068b46d5e2
- fix mrbc_filename leak; cxt->filename would not be freed until the state is closed.
2016-09-04 18:35:23 +09:00
Paolo Bosetti
ac9b6f2a11
In mrbgem_spec.rake, added support for @mrblib_dir @objs_dir, so that a gem can have custom source directory names
2016-09-02 17:38:40 +02:00
Yukihiro "Matz" Matsumoto
bf0893586a
Merge pull request #3192 from ksss/instance_eval
...
instance_eval env should remake Fix #3191
2016-08-31 23:15:42 +09:00
Yukihiro "Matz" Matsumoto
b3236b2a71
mruby-random: fixed typos
2016-08-30 10:52:44 +09:00
Yukihiro "Matz" Matsumoto
fa76bbeb07
mruby-random: add reporting URL since we modified the source
2016-08-30 09:03:14 +09:00
Yukihiro "Matz" Matsumoto
22dc84f72a
Fixed spell errors in test/t/lang.rb; ref #3199
2016-08-20 21:57:20 +09:00
Yukihiro "Matz" Matsumoto
c313fdfed0
Merge pull request #3199 from miura1729/original
...
Add new test for optimize VM
2016-08-20 21:35:17 +09:00
Miura Hideki
1751d8fd3b
Add new test for optimize VM
2016-08-20 20:30:37 +09:00
Yukihiro "Matz" Matsumoto
ff3e4b91f2
Move Module#include and #prepend to class.c; ref #3197
...
To avoid VM nesting with mrb_funcall()
2016-08-20 00:03:30 +09:00
Yukihiro "Matz" Matsumoto
b2fceae461
renamed class.rb and error.rb to ensure they are read first; ref #3197
2016-08-19 14:10:23 +09:00
Yukihiro "Matz" Matsumoto
67ad1ff11e
Merge pull request #3198 from nobu/feature/lparen_arg-stmt
...
parse.y: lparen_arg statement
2016-08-19 12:52:40 +09:00
Nobuyoshi Nakada
73dd82e30a
parse.y: lparen_arg statement
...
allow parenthesised statement as a method argument.
reported [Feature:12686] in bugs.ruby-lang.org fixed in CRuby 2.4.
2016-08-19 11:11:54 +09:00
Yukihiro "Matz" Matsumoto
0597f66b23
Merge pull request #3196 from mimaki/fix-negative-ord
...
Fix String#ord failure which return a negative value
2016-08-17 17:00:01 +09:00
Hiroshi Mimaki
861b0eed7b
Fix String#ord failure which return a negative value
2016-08-17 15:29:59 +09:00
Yukihiro "Matz" Matsumoto
ee40f9bbbd
Merge pull request #3195 from franckverrot/master
...
Correct method name
2016-08-16 13:44:23 +09:00
Franck Verrot
f6a2f67648
Correct method name
2016-08-15 20:49:32 -07:00
Yukihiro "Matz" Matsumoto
86821379fd
Merge pull request #3194 from nobu/chained-rhs
...
parse.y: fix chained assignments
2016-08-13 14:06:35 +09:00
Nobuyoshi Nakada
bdd7e2bc8c
parse.y: fix chained assignments
...
fix syntax errors with chained assignment with op assign.
reported [Bug:12669] in bugs.ruby-lang.org fixed in CRuby 2.4.
2016-08-13 13:56:14 +09:00
Yukihiro "Matz" Matsumoto
bee34fb9bd
Merge pull request #3193 from nobu/rhs-rescue
...
parse.y: simplify 90e8ce5
2016-08-12 10:29:46 +09:00
Nobuyoshi Nakada
a06940daa9
parse.y: simplify 90e8ce5
...
simplify tOP_ASGN rules by command_rhs and arg_rhs rules with
%prec.
2016-08-12 10:14:35 +09:00
Yukihiro "Matz" Matsumoto
90e8ce5c30
parse.y: rescue modifiers for OP_ASGN should protect rhs only
...
reported in [Bug:12402] in bugs.ruby-lang.org fixed in CRuby 2.4
2016-08-11 16:27:14 +09:00
ksss
ada264a513
instance_eval env should remake Fix #3191
2016-08-08 12:41:19 +09:00
Yukihiro "Matz" Matsumoto
7a7fac8412
removed ChangeLog that has not been updated for long time; ref #3190
2016-08-08 12:38:21 +09:00
Yukihiro "Matz" Matsumoto
af4567bb41
update copyright notice and license description for mt19937ar.[ch]
...
despite the fact original authors agreed to distribute their work
under MIT license, it does not mean mt19937ar.[ch] became the work
of mruby developers. To clarify, we updated copyright and license
notice of the source files.
2016-08-08 12:38:21 +09:00
Yukihiro "Matz" Matsumoto
501e1ef260
Merge pull request #3189 from wrl/public-hash-values
...
make mrb_hash_values() a public API function
2016-08-03 02:26:04 +09:00
William Light
e02a88e031
make mrb_hash_values() a public API function
2016-08-01 11:05:46 +02:00
Yukihiro "Matz" Matsumoto
eb7422af58
Merge pull request #3188 from guoxiao/warning
...
intptr_t should be used instead of uint32_t to hold a pointer.
2016-07-31 14:37:39 +09:00
Guo Xiao
339005e1d5
intptr_t should be used instead of uint32_t to hold a pointer.
...
Fix warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
2016-07-31 12:53:39 +08:00
Yukihiro "Matz" Matsumoto
42fefef916
Merge pull request #3186 from rmalizia44/patch-2
...
Update mirb.c
2016-07-28 10:59:32 +09:00
Malizia R
1c7572bc6a
Update mirb.c
2016-07-27 16:51:10 -03:00
Yukihiro "Matz" Matsumoto
2b4ed40fc9
Merge pull request #3185 from kou/string-reduce-needless-array
...
Reduce needless Array generation in some String methods
2016-07-27 14:03:52 +09:00
Kouhei Sutou
6bb0775d76
Reduce needless Array generation in some String methods
...
Here are some benchmarks:
each_char:
# /tmp/each_char.rb
a = "a" * 1000000
a.each_char do |x|
end
Without this change:
% time bin/mruby /tmp/each_char.rb
bin/mruby /tmp/each_char.rb 1.07s user 0.02s system 99% cpu 1.088 total
With this change:
% time bin/mruby /tmp/each_char.rb
bin/mruby /tmp/each_char.rb 0.52s user 0.01s system 99% cpu 0.530 total
2 times faster with this change.
codepoints:
# /tmp/codepoints.rb
a = "a" * 1000000
a.codepoints do |x|
end
Without this change:
% time bin/mruby /tmp/codepoints.rb
bin/mruby /tmp/codepoints.rb 1.16s user 0.05s system 99% cpu 1.216 total
With this change:
% time bin/mruby /tmp/codepoints.rb
bin/mruby /tmp/codepoints.rb 0.56s user 0.02s system 99% cpu 0.589 total
2016-07-27 13:58:07 +09:00
Yukihiro "Matz" Matsumoto
3757b16dab
Merge pull request #3184 from ksss/each_char
...
Support to call without block to String#each_char
2016-07-27 02:32:04 +09:00
ksss
bef63a4f91
Support to call without block to String#each_char
2016-07-26 18:46:23 +09:00
Yukihiro "Matz" Matsumoto
32ad74f4d1
Merge pull request #3182 from sdottaka/fix-broken-msvc-build
...
Fix broken msvc build
2016-07-26 00:13:53 +09:00
Yukihiro "Matz" Matsumoto
e635dc2a47
Merge pull request #3181 from sdottaka/fix-crash-on-mrb_parser_free
...
Fix crash in mrb_parser_free() due to freed memory access
2016-07-26 00:12:54 +09:00
Yukihiro "Matz" Matsumoto
62a16673a6
Merge pull request #3183 from Mav7/mav7/docs
...
yard docs for string.h
2016-07-25 15:07:30 +09:00
Yukihiro "Matz" Matsumoto
a66a1e92e7
Merge pull request #3179 from ksss/struct
...
Should not define to `Struct` class
2016-07-25 14:19:10 +09:00
Yukihiro "Matz" Matsumoto
34ac707ea3
OP_ASGN vsp may be negative
...
reported by https://gist.github.com/miura1729/53fbd8af889c289a79108e38635b2378
fix proposed by @miura1729 in
https://github.com/miura1729/mruby/commit/b1b7933f7aa950cfb747b06327a0d0340f3e4ff8
2016-07-25 11:34:55 +09:00
Yukihiro "Matz" Matsumoto
417092360d
Fixed crash error when #initialize is redefined for Struct; fix #3177
...
refactored redundant functions; removed optimized accessors for safety
this fix also close #3178
2016-07-25 10:32:10 +09:00
Ralph Desir(Mav7)
189ad47346
yard docs for string.h
2016-07-23 02:47:32 -04:00
Takashi Sawanaka
fb1c4b3ba7
Fix broken msvc build
2016-07-23 11:57:36 +09:00
Takashi Sawanaka
2eefbfed9d
Fix crash in mrb_parser_free() due to freed memory access
2016-07-23 11:34:04 +09:00
ksss
bf21063a72
Add regression test
2016-07-22 15:26:17 +09:00
ksss
1a8074accf
Should not define to Struct class
2016-07-22 15:26:11 +09:00
Yukihiro "Matz" Matsumoto
97283faa16
Merge pull request #3176 from ksss/string-insert
...
String#insert should be destructive
2016-07-15 01:22:02 +09:00
ksss
d83d9cd164
String#insert should be destructive
2016-07-14 21:33:15 +09:00
Yukihiro "Matz" Matsumoto
72b28f1ed6
Merge pull request #3174 from ksss/local-jump-error
...
Should raise LocalJumpError when no block given
2016-07-14 17:10:54 +09:00
ksss
9dc820590f
Should raise LocalJumpError when no block given
2016-07-14 13:03:25 +09:00
Yukihiro "Matz" Matsumoto
d4d807b774
relax string length limitation to 64KB; fix #2725
2016-07-13 03:22:15 +09:00
Yukihiro "Matz" Matsumoto
2e74a93112
Merge pull request #3171 from kjunichi/c-has-no-try
...
C doesn't have try-catch
2016-07-08 12:14:46 +09:00
Junichi Kajiwara
f67631afb4
C doesn't have try-catch
2016-07-08 06:30:45 +09:00
Yukihiro "Matz" Matsumoto
0d9aa830aa
Merge pull request #3169 from ksss/Wshift-negative-value
...
Fix warning shift-negative-value
2016-07-02 00:55:00 +09:00
ksss
e3bc81e75e
Fix warning shift-negative-value
2016-07-01 22:00:55 +09:00
Yukihiro "Matz" Matsumoto
3c406d54be
Merge pull request #3166 from yyamano/fix-gc-profile
...
Fix compilation error with GC_PROFILE.
2016-06-30 14:32:53 +09:00
Yuji Yamano
00faf3d317
Fix compilation error with GC_PROFILE.
2016-06-29 03:57:02 -04:00
Yukihiro "Matz" Matsumoto
fa1c1ab487
Merge pull request #3163 from mattn/fix-public_methods
...
Fix public methods
2016-06-18 11:40:32 +09:00
Yasuhiro Matsumoto
8a15ab0c0c
add test for public_methods(false)
2016-06-18 01:21:21 +09:00
Yasuhiro Matsumoto
8764bd282c
fix public_methods(false)
2016-06-18 01:18:24 +09:00
Yukihiro "Matz" Matsumoto
a8af43f61e
Merge pull request #3162 from udzura/patch-1
...
Update doc, write about add_test_dependency
2016-06-14 19:10:04 +09:00
Uchio KONDO
481aa31f93
Update doc, write about add_test_dependency
2016-06-14 16:37:06 +09:00
Yukihiro "Matz" Matsumoto
09b11850a5
mrb_gc_unregister() to remove one registration; close #3160
...
when multiple mrb_gc_register() were called for the same object
2016-06-10 10:12:48 +09:00
Yukihiro "Matz" Matsumoto
44de80f76d
fix a compiler warning for uninitialized variable
2016-06-10 10:11:58 +09:00
Yukihiro "Matz" Matsumoto
8dde647a51
add temporary workaround for irep memory corruption
...
need to find out real memory bug that appears in full-debug/mrbtest
2016-06-10 10:04:52 +09:00
Yukihiro "Matz" Matsumoto
6b0299f72b
fixed remaining bugs in OP_ASGN stack adjustment; close #3159
2016-05-16 15:36:36 +09:00
Yukihiro "Matz" Matsumoto
29d3a40418
stack adjustment after NODE_OP_ASGN with NODE_CALL was wrong; fix #3159
2016-05-16 01:49:24 +09:00
Yukihiro "Matz" Matsumoto
2e81fee731
parser_dump() to show symbol number for NODE_SYM
2016-05-16 01:49:24 +09:00
Yukihiro "Matz" Matsumoto
5933651ac7
Merge pull request #3157 from cremno/add-mrb_int_mul_overflow
...
add function for checked mrb_int multiplication
2016-05-11 09:41:19 +09:00
cremno
7453a5dfea
use mrb_int_mul_overflow()
2016-05-10 19:12:02 +02:00
cremno
6369374f79
add mrb_int_mul_overflow(); close #3149
...
- call __builtin_mul_overflow() if it's available
- perform a 64-bit multiplication for 32-bit mrb_int (default)
- otherwise a much slower method is used
2016-05-10 19:10:49 +02:00
Yukihiro "Matz" Matsumoto
0be4b8960e
Merge pull request #3156 from cremno/fix-mruby_version-value
...
fix MRUBY_VERSION value
2016-05-10 10:04:31 +09:00
Yukihiro "Matz" Matsumoto
4fd0cb61d7
Merge pull request #3154 from cremno/improve-checked-mrb_int-arithmetic-implementation
...
improve checked mrb int arithmetic implementation
2016-05-10 10:04:04 +09:00
Yukihiro "Matz" Matsumoto
bc715f9938
Merge pull request #3155 from cremno/fix-3152
...
fix #3152
2016-05-10 09:18:25 +09:00
cremno
bf63cff46e
fix MRUBY_VERSION value
...
RUBY_ENGINE_VERSION and MRUBY_VERSION should refer to the same string.
2016-05-09 17:19:47 +02:00
cremno
309791b3ae
raise the error at runtime; fix #3152
2016-05-09 16:57:56 +02:00
cremno
7276e84637
use type-generic checked arithmetic builtins
...
Version checking is not reliable - especially with Clang.
E.g. Apple's Clang (Xcode) uses different version numbers.
A feature check (__has_builtin) is the recommened way.
Add the MRB_HAVE_TYPE_GENERIC_CHECKED_ARITHMETIC_BUILTINS
macro which may be used in other files.
2016-05-09 16:52:57 +02:00
cremno
39b6a9dafc
define macros only if builtins are n/a
2016-05-09 16:34:20 +02:00
Yukihiro "Matz" Matsumoto
b4e1889813
Merge pull request #3153 from kou/remove-needless-assignment
...
Remove needless assignment
2016-05-09 17:35:19 +09:00
Kouhei Sutou
51cc35dc09
Remove needless assignment
...
d4ee409ae9 should remove this line.
2016-05-09 14:05:51 +09:00
Yukihiro "Matz" Matsumoto
ea033526fb
Merge pull request #3151 from okkez/use-stack-directly
...
Use stack directly
2016-04-27 12:14:54 +09:00
Kenji Okimoto
d4ee409ae9
Use stack directly
...
See https://github.com/mruby/mruby/pull/3142#issuecomment-201138873
2016-04-27 10:18:13 +09:00
Yukihiro "Matz" Matsumoto
8f0c1c7d3c
mruby-sprintf:fix double negative signs in printf; fix #3148
...
MRB_INT_MAX does not have corresponding positive integer
2016-04-23 23:50:01 +09:00
Yukihiro "Matz" Matsumoto
c5229074bb
mruby-sprintf: format specifiers o,u,x,b ignore sign(+); ref #3148
2016-04-23 22:20:11 +09:00
Yukihiro "Matz" Matsumoto
e5c2013829
Merge pull request #3147 from ksss/1.8
...
Avoid Syntax Error on CRuby v1.8
2016-04-16 23:27:15 +09:00
ksss
451523ff02
Avoid Syntax Error on CRuby v1.8
...
CRuby v1.8 dose not support named capture
2016-04-16 22:39:09 +09:00
Yukihiro "Matz" Matsumoto
fa1a17cbc4
Merge pull request #3145 from timoschilling/patch-1
...
fix syntax highlighting
2016-04-14 00:04:54 +09:00
Timo Schilling
1863f325c0
fix syntax highlighting
2016-04-13 13:41:31 +02:00
Yukihiro "Matz" Matsumoto
8c67e915b4
mruby-eval: instance_eval should keep target_class; close #3141
2016-04-11 14:28:44 +09:00
Yukihiro "Matz" Matsumoto
ae5b5ce575
vm.c: mrb_hash_set() may reallocate VM stack; close #3133
2016-04-11 14:11:44 +09:00
Yukihiro "Matz" Matsumoto
d97a37eb7b
fix possible memory leak in mruby-time gem
2016-04-04 21:58:46 +09:00
Yukihiro "Matz" Matsumoto
e1e888e354
fix too much optimization for ||=
2016-04-01 01:22:16 +09:00
Yukihiro "Matz" Matsumoto
d098d823de
fix duplicated eval in op_asgn
...
`a` in `a.m += c` or `a[b] += c` should be evaluated only once.
2016-03-30 20:43:57 +09:00
Yukihiro "Matz" Matsumoto
4979b52d61
reduce OP_ARRAY in argument splat
2016-03-30 01:35:11 +09:00
Yukihiro "Matz" Matsumoto
0e03a7f2a3
mruby-enum-ext: refine minmax
2016-03-30 01:12:18 +09:00
Yukihiro "Matz" Matsumoto
4d909d8b2b
Merge pull request #3142 from kou/add-missing-regs-update
...
Add missing regs update
2016-03-25 13:41:35 +09:00
Kouhei Sutou
c69cba2ad9
Add missing regs update
...
mrb_vm_define_class() may realloc() mrb->c->stack because it calls
mrb_funcall() for inherited hook. If mrb->c->stack is realloc()-ed, regs
refers orphan address.
2016-03-25 00:25:48 +09:00
Yukihiro "Matz" Matsumoto
dd072b5364
remove wrong ISO section from safe navigation test; ref 4c1ce0f6
2016-03-24 23:35:04 +09:00
Yukihiro "Matz" Matsumoto
3886becec5
better code generation for ||=; #3138
2016-03-24 16:03:58 +09:00
Yukihiro "Matz" Matsumoto
1ce471c1cc
||= with cvars and constants should work with false values; #3138
2016-03-24 07:59:58 +09:00
Yukihiro "Matz" Matsumoto
4fcff34747
||= reference error can happen with constants as well; #3138
2016-03-23 23:51:23 +09:00
Yukihiro "Matz" Matsumoto
817b884343
add #dig tests
2016-03-23 12:34:32 +09:00
Yukihiro "Matz" Matsumoto
daf83946bb
add #dig to Array,Hash and Struct
2016-03-23 11:49:28 +09:00
Yukihiro "Matz" Matsumoto
4c1ce0f61c
add safe-navigation operator tests
2016-03-23 08:51:25 +09:00
Yukihiro "Matz" Matsumoto
21a3ae08f7
add safe-navigation (aka lonely) operator &.
2016-03-23 08:51:25 +09:00
Yukihiro "Matz" Matsumoto
7d0612528e
Merge pull request #3139 from cremno/fix-vs2010-build
...
deprecate and fix VS2010/2012 build
2016-03-23 00:22:26 +09:00
cremno
30b0100e6c
fix VS2010/2012 build
...
They don't have <inttypes.h>, only <stdint.h>.
2016-03-22 11:46:49 +01:00
cremno
bfc7b2e30f
deprecate Visual Studio 2010 and 2012
2016-03-22 11:41:16 +01:00
cremno
611e99e741
remove unnecessary array/each
2016-03-22 11:38:09 +01:00
Yukihiro "Matz" Matsumoto
2b0baec32a
fixed silly class variable/constant confusion; #3138
2016-03-22 00:06:32 +09:00
Yukihiro "Matz" Matsumoto
a02acf2635
rescue NameError from class variable access like @@foo ||= 42; fix #3138
2016-03-21 03:49:08 +09:00
Yukihiro "Matz" Matsumoto
643d967b10
Merge pull request #3131 from bggd/fix_bintest_on_windows
...
Fix doesn't work bintest on :visualcpp toolchain
2016-03-16 16:29:14 +09:00
Yukihiro "Matz" Matsumoto
52d388515f
Merge pull request #3132 from pbosetti/edison
...
Added example for cross-compiling on Intel Edison
2016-03-16 16:28:35 +09:00
Yukihiro "Matz" Matsumoto
273eac6b64
Merge pull request #3136 from bggd/add_appveyor
...
Add appveyor.yml
2016-03-16 16:27:58 +09:00
bggd
51cb72962d
Create appveyor_config.rb
2016-03-15 20:43:51 +09:00
bggd
87e5b0f30c
Add appveyor.yml for Visual Studio 2015/2013
2016-03-15 20:41:15 +09:00
Yukihiro "Matz" Matsumoto
4f20d58ac2
Merge pull request #3135 from wanabe/reduce-include-paths
...
Reduce compiler include_paths
2016-03-14 09:35:53 +09:00
wanabe
2aa6b449a2
Reduce compiler include_paths
2016-03-13 17:06:39 +09:00
Paolo Bosetti
a27426aa8d
Added example for cross-compiling on Intel Edison
2016-03-07 17:50:03 +01:00
bggd
a138ae3506
Fix doesn't work bintest on :visualcpp toolchain
2016-03-07 14:50:21 +09:00
Yukihiro "Matz" Matsumoto
41d6ba23b5
fix dump_prefix() with wrong type argument; fix #3128
2016-03-07 10:59:34 +09:00
Yukihiro "Matz" Matsumoto
0c28c7d754
change backtrace sep from const char* to char
2016-03-07 10:59:34 +09:00
Yukihiro "Matz" Matsumoto
4e95779851
Merge pull request #3125 from zzak/default-benchmark-build-config
...
Add default benchmark build config
2016-03-07 10:27:36 +09:00
Yukihiro "Matz" Matsumoto
b4d946f6bc
Merge pull request #3129 from kou/fix-segv-by-backtrace-and-gc
...
Fix SEGV by backtrace and GC
2016-03-06 12:15:55 +09:00
Yukihiro "Matz" Matsumoto
1a4540fb4a
Merge pull request #3127 from kou/suppress-warning
...
Suppress a warning
2016-03-06 12:13:05 +09:00
Kouhei Sutou
f1eb3aea11
Fix segmentation fault by backtrace and GC
...
GitHub: fix #3122
It reverts #3126 . #3126 fixes the segmentation fault but generates
broken backtrace.
This change fixes the segmentation fault and generates correct
backtrace. The strategy of this change is "generating backtrace while
irep is alive".
/tmp/test.rb:
def gen
e0 = nil
begin
1.times {
raise 'foobar'
}
rescue => e
e0 = e
end
e0
end
e = gen
GC.start
gen
GC.start
puts e.backtrace.join("\n")
Run:
% bin/mruby /tmp/test.rb
/tmp/test.rb:5:in Object.gen
/home/kou/work/ruby/mruby.kou/mrblib/numeric.rb:77:in Integral#times
/tmp/test.rb:4:in Object.gen
/tmp/test.rb:13
FYI:
% ruby -v /tmp/test.rb
ruby 2.3.0p0 (2015-12-25) [x86_64-linux-gnu]
/tmp/test.rb:5:in `block in gen'
/tmp/test.rb:4:in `times'
/tmp/test.rb:4:in `gen'
/tmp/test.rb:13:in `<main>'
2016-03-06 11:58:54 +09:00
Kouhei Sutou
d77c72dac5
Revert "Merge pull request #3126 from jbreeden/backtrace_irep_null_check"
...
This reverts commit bf7719fe8d , reversing
changes made to 4f4fa0ade0 .
We should get backtrace while irep is alive.
2016-03-06 11:51:04 +09:00
Kouhei Sutou
e5cce388ff
Suppress a warning
...
mrbgems/mruby-eval/src/eval.c: In function ‘create_proc_from_string’:
mrbgems/mruby-eval/src/eval.c:152:10: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
file = "(eval)";
^
2016-03-06 10:05:14 +09:00
Yukihiro "Matz" Matsumoto
bf7719fe8d
Merge pull request #3126 from jbreeden/backtrace_irep_null_check
...
Null check for irep & initialize loc.lineno
2016-03-06 08:44:15 +09:00
jbreeden
d2a8f7e0cc
Fix Travis CI
2016-03-05 14:22:31 -08:00
jbreeden
e02ff850fe
Null check for irep & initialize loc.lineno
2016-03-05 13:45:56 -08:00
Zachary Scott
aa90ad57fe
Add default benchmark build config
2016-03-04 16:14:13 +09:00
Yukihiro "Matz" Matsumoto
4f4fa0ade0
Merge pull request #3121 from asfluido/master
...
The original code crashed when mrb->backtrace.n grew to 16.
2016-02-29 10:22:00 +09:00
Carlo Prelz
d6cbe1bfc6
The original code crashed when mrb->backtrace.n grew to 16.
...
It looks like the logic to reallocate the backtrace was flawed,
based on the wrong variable (loc_raw->i, which, as I have verified,
decreases from 16 to 0 instead of increasing)
I am not sure if this is the correct fix
2016-02-26 09:21:33 +01:00
Yukihiro "Matz" Matsumoto
0c23d5a353
Merge pull request #3120 from rmalizia44/patch-1
...
Avoid Error when Compiling with -std=c99 flag
2016-02-25 08:55:41 +09:00
Malizia R
52aba8a706
Avoid Error when Compiling with -std=c99 flag
2016-02-24 16:39:38 -03:00
Yukihiro "Matz" Matsumoto
b8479b62d8
too many register push for else-less condtions; fix #3117
2016-02-22 09:55:51 +09:00
Yukihiro "Matz" Matsumoto
81acbd2dd1
cosmetic change for OP_EQ
2016-02-22 09:38:20 +09:00
Yukihiro "Matz" Matsumoto
cf5ca03676
mruby-struct: copied Struct length is not initialized; fix #3114
2016-02-19 11:46:18 +09:00
Yukihiro "Matz" Matsumoto
819c9da8d2
peephole optimization for LOADNIL before STRCAT; ref #3110
2016-02-17 11:03:27 +09:00
Yukihiro "Matz" Matsumoto
d8fc09cf92
push value for NULL AST when value is required; fix #3110
2016-02-17 11:02:29 +09:00
Yukihiro "Matz" Matsumoto
ec35e549ad
need to free context when reclaiming fiber object in GC; fix #3109
2016-02-17 10:19:14 +09:00
Yukihiro "Matz" Matsumoto
da96c335fe
syntax error in interpolated symbol; fixed #3108
2016-02-16 11:33:58 +09:00
Yukihiro "Matz" Matsumoto
5596d14c00
Merge pull request #3107 from mame/fix-enum-hash
...
[255, 255, 255, 255, 255].hash raises "can't convert Float into Integer"
2016-02-16 10:43:12 +09:00
Yukihiro "Matz" Matsumoto
683ff0cbd0
Merge pull request #3106 from mame/fix-eval-no-filename
...
Fix segfault when `eval("__FILE__")` is executed
2016-02-16 10:42:28 +09:00
Yusuke Endoh
a1a157b27e
suppress "can't convert Float into Integer" in Enumerable#hash
2016-02-16 00:07:50 +09:00
Yusuke Endoh
668cc1b435
Fix segfault when eval("__FILE__") is executed
2016-02-15 23:57:18 +09:00
Yukihiro "Matz" Matsumoto
74d52a11f2
Merge pull request #3101 from deuwert/fix-test-build
...
Fix bug in mruby-test gem (fix #3094 )
2016-02-12 08:27:55 +09:00
Yukihiro "Matz" Matsumoto
60c1ed4461
Merge pull request #3102 from deuwert/add-limits
...
Add more limitations
2016-02-12 08:27:04 +09:00
Daniel Bovensiepen
299cb5a7b9
Fix formatting again...
2016-02-12 03:37:36 +08:00
Daniel Bovensiepen
46fbd5349b
Add more limitations:
...
- defined?
- alias on global variables
- Operator modification
- Kernel.binding missing
2016-02-12 03:32:41 +08:00
Daniel Bovensiepen
5976185c0a
Fix bug in mruby-test gem.
...
In an used build path mruby-test wasn't updating mrbtest.c in the
case that the mgem selection was changed. This lead to:
- a missing reference in case a GEM was removed
- ignoring all new GEMs added to the build configuration
This fix keeps track of the active gems and demands a rebuild of
mrbtest.c in case that the gem selection changed.
2016-02-12 02:19:18 +08:00
Yukihiro "Matz" Matsumoto
37344ecaad
fixed typos in limitations.md
2016-02-12 00:54:07 +09:00
Yukihiro "Matz" Matsumoto
473827d1d1
Merge pull request #3100 from deuwert/toolchain-openwrt
...
Add toolchain support for OpenWRT
2016-02-12 00:48:13 +09:00
Yukihiro "Matz" Matsumoto
f40fc9ab69
Merge pull request #3099 from deuwert/more-limits
...
Addition to mruby limitation documentation
2016-02-12 00:46:28 +09:00
Daniel Bovensiepen
fcbaafaa2c
Add toolchain support for OpenWRT
2016-02-11 21:32:42 +08:00
Daniel Bovensiepen
e7eb40f9d6
Fix formatting
2016-02-11 21:23:29 +08:00
Daniel Bovensiepen
44d26dd994
Add more limitations
2016-02-11 21:19:48 +08:00
Yukihiro "Matz" Matsumoto
18870428bc
add 1/2 description to limitations.md file
2016-02-11 16:50:01 +09:00
Yukihiro "Matz" Matsumoto
b3a2d8bec5
Merge pull request #3098 from deuwert/limitations
...
Limitations
2016-02-11 15:34:04 +09:00
Daniel Bovensiepen
983948c5be
Small format fix
2016-02-11 04:48:57 +08:00
Daniel Bovensiepen
3bbc486cf9
Add limitation file
2016-02-11 04:38:29 +08:00
Yukihiro "Matz" Matsumoto
62b06ab4d4
[cppcheck] mrb_str_rindex() remove unnecessary len update by chars2bytes()
2016-02-05 21:54:07 +09:00
Yukihiro "Matz" Matsumoto
af4dd3d579
[cppcheck] remove duplicated break
2016-02-05 21:48:44 +09:00
Yukihiro "Matz" Matsumoto
3c73c315f4
Hash: check flags before accessing ifnone; ref #980
2016-02-05 10:08:28 +09:00
Yukihiro "Matz" Matsumoto
25e4ec3f37
cache UTF8 status for utf8_strlen(); ref #980
2016-02-04 23:33:16 +09:00
Yukihiro "Matz" Matsumoto
5e514c910f
cache mrb_regexp_p(); ref #980
2016-02-04 23:22:01 +09:00
Yukihiro "Matz" Matsumoto
4344ca0aca
Merge pull request #3096 from hlogmans/master
...
Fix missing dependency on mruby-print to support 'puts'
2016-02-04 10:15:08 +09:00
Hugo Logmans
ed5bf72bcf
Fix missing dependency on mruby-print to support 'puts'
2016-02-03 15:05:44 +01:00
Yukihiro "Matz" Matsumoto
ce84e42f41
Merge pull request #3093 from retrage/retrage/dev
...
Add String#rjust to mruby-string-ext
2016-01-31 11:41:01 +09:00
Yukihiro "Matz" Matsumoto
ac5649700c
Merge pull request #3092 from kenhys/fix-suported
...
Fix a typo
2016-01-31 11:26:20 +09:00
HAYASHI Kentaro
9442cb9652
Fix a typo
...
su ported ->
supported
^
2016-01-31 00:48:12 +09:00
Akira Moroo
cb1a80e741
Add String#rjust test to mruby-string-ext
2016-01-30 14:28:00 +09:00
Akira Moroo
e86bc6bb47
Add String#rjust to mruby-string-ext
2016-01-30 14:25:53 +09:00
Yukihiro "Matz" Matsumoto
c35a25c51e
Merge pull request #3091 from visualsayed/fix_hash_replace_method
...
protect NoMethodError from calling to_hash in replace
2016-01-28 12:17:51 +09:00
Sayed Abdelhaleem
f5f48d9400
protect NoMethodError from calling to_hash in replace
2016-01-27 21:17:33 +02:00
Yukihiro "Matz" Matsumoto
2723b10a01
Merge pull request #3090 from kou/fix-segv-by-stack-extension-in-mrb-get-args
...
Fix SEGV by stack extension in mrb_get_args()
2016-01-22 00:50:15 +09:00
Kouhei Sutou
c77123d20a
Fix SEGV by stack extension in mrb_get_args()
...
mrb_get_args() keeps pointer of the current stack. But address of the
current stack maybe changed by method call.
'i' format character calls #to_i when the argument isn't integer but
has #to_i.
Here is a code that may call #to_i in mrb_get_args():
case 'i':
// ...
default:
*p = mrb_fixnum(mrb_Integer(mrb, ARGV[arg_i]));
break;
// ...
Here is a code #to_i is called:
class X
def initialize(i)
@i = i
end
def to_i
@i
end
end
[][X.new(0), 0] # X#to_i is called
So, mrb_get_args() shouldn't keep pointer and use it. mrb_get_args()
should always refer mrb->ci->stack to use valid address of the current
stack.
2016-01-22 00:20:00 +09:00
Yukihiro "Matz" Matsumoto
8a74e68552
mruby-random: fixed wrong fixnum conversion
2016-01-21 03:31:08 +09:00
Yukihiro "Matz" Matsumoto
8d78c49e9a
Merge pull request #3088 from maclover7/patch-1
...
Small grammar fix
2016-01-20 15:14:46 +09:00
Jon Moss
793a62954e
Small grammar fix
...
[ci skip]
2016-01-19 22:37:44 -05:00
Yukihiro "Matz" Matsumoto
17bd40a566
Merge pull request #3087 from kou/fix-segv-on-rerasing-no-memory-error
...
Fix SEGV on re-raising NoMemoryError
2016-01-19 17:36:51 +09:00
Kouhei Sutou
1d84b3205a
Fix SEGV on re-raising NoMemoryError
...
Think about the following Ruby script:
segv.rb:
begin
lambda do
lambda do
"x" * 1000 # NoMemoryError
end.call
end.call
rescue
raise
end
If memory can't allocate after `"x" * 1000`, mruby crashes.
Because L_RAISE: block in mrb_vm_exec() calls mrb_env_unshare() via
cipop() and mrb_env_unshare() uses allocated memory without NULL check:
L_RAISE: block:
L_RAISE:
// ...
while (ci[0].ridx == ci[-1].ridx) {
cipop(mrb);
// ...
}
cipop():
static void
cipop(mrb_state *mrb)
{
struct mrb_context *c = mrb->c;
if (c->ci->env) {
mrb_env_unshare(mrb, c->ci->env);
}
c->ci--;
}
mrb_env_unshare():
MRB_API void
mrb_env_unshare(mrb_state *mrb, struct REnv *e)
{
size_t len = (size_t)MRB_ENV_STACK_LEN(e);
// p is NULL in this case
mrb_value *p = (mrb_value *)mrb_malloc(mrb, sizeof(mrb_value)*len);
MRB_ENV_UNSHARE_STACK(e);
if (len > 0) {
stack_copy(p, e->stack, len); // p is NULL but used. It causes SEGV.
}
e->stack = p;
mrb_write_barrier(mrb, (struct RBasic *)e);
}
To solve the SEGV, this change always raises NoMemoryError even when
realloc() is failed after the first NoMemoryError in
mrb_realloc(). mrb_unv_unshare() doesn't need to check NULL with this
change.
But it causes infinite loop in the following while:
L_RAISE:
// ...
while (ci[0].ridx == ci[-1].ridx) {
cipop(mrb);
// ...
}
Because cipop() never pops ci.
This change includes cipop() change. The change pops ci even when
mrb_unv_unshare() is failed by NoMemoryError.
This case can be reproduced by the following program:
#include <stdlib.h>
#include <mruby.h>
#include <mruby/compile.h>
static void *
allocf(mrb_state *mrb, void *ptr, size_t size, void *ud)
{
static mrb_bool always_fail = FALSE;
if (size == 1001) {
always_fail = TRUE;
}
if (always_fail) {
return NULL;
}
if (size == 0) {
free(ptr);
return NULL;
} else {
return realloc(ptr, size);
}
}
int
main(int argc, char **argv)
{
mrb_state *mrb;
mrbc_context *c;
FILE *file;
mrb = mrb_open_allocf(allocf, NULL);
c = mrbc_context_new(mrb);
file = fopen(argv[1], "r");
mrb_load_file_cxt(mrb, file, c);
fclose(file);
mrbc_context_free(mrb, c);
mrb_close(mrb);
return EXIT_SUCCESS;
}
Try the following command lines:
% cc -I include -L build/host/lib -O0 -g3 -o no-memory no-memory.c -lmruby -lm
% ./no-memory segv.rb
2016-01-19 16:37:42 +09:00
Yukihiro "Matz" Matsumoto
70d24a9e5f
Merge pull request #3086 from pra85/2016
...
Update license year range to 2016
2016-01-18 13:08:17 +09:00
Prayag Verma
70283a94a5
Update license year range to 2016
2016-01-18 08:55:12 +05:30
Yukihiro "Matz" Matsumoto
2e49a13163
Merge pull request #3084 from syohex/all-zeros
...
Fix passing all zero string to Kernel#Integer
2016-01-14 16:38:58 +09:00
Syohei YOSHIDA
787685a0b9
Fix all zero string case
2016-01-14 11:07:07 +09:00
Syohei YOSHIDA
2a661ac612
Add tests which passes all zero string to Kernel#Integer
2016-01-14 11:05:03 +09:00
Yukihiro "Matz" Matsumoto
4924856949
Merge pull request #3082 from jefffederman/feature/install-mruby-with-ruby-install
...
Update README to mention ruby version management tools
2016-01-14 00:49:25 +09:00
Jeff Federman
d2961203b5
Update README to mention ruby version management tools
2016-01-13 10:30:15 -05:00
Yukihiro "Matz" Matsumoto
2f7efda346
Merge pull request #3081 from val00274/fix_toolchains_params
...
Fix build error in ruby 1.8.
2016-01-13 17:02:38 +09:00
asatou
d0668cf9c9
Fix build error in ruby 1.8.
...
Apply change of #2978 to :clang, :gcc, :visualcpp toolchains
2016-01-13 16:02:58 +09:00
Yukihiro "Matz" Matsumoto
8143285956
Merge pull request #3080 from kou/fix-class-variable-in-module
...
Fix class variable reference in module
2016-01-11 10:00:34 +09:00
Kouhei Sutou
ad492eb9f3
Fix class variable reference in module
...
Fix #3079
2016-01-11 00:34:15 +09:00
Yukihiro "Matz" Matsumoto
fb2e0b721f
fixed a problem with upvar access from instance_eval; ref #3072
2016-01-08 09:07:58 +09:00
Yukihiro "Matz" Matsumoto
0000192710
Merge pull request #3077 from sgnr/output-backtrace-segfault
...
Fix segfault on mrb_exc_backtrace.
2016-01-08 08:40:30 +09:00
Simon Génier
146a9eeb38
Fix segfault on mrb_exc_backtrace.
...
The code to iterate over backtrace locations was changed in #3065 , but
unfortunately output_backtrace was not correctly updated to forward the
callback.
2016-01-07 11:24:16 -05:00
Yukihiro "Matz" Matsumoto
f3cce24035
replace mrb_toplevel_run() by mrb_top_run()
2016-01-07 22:48:22 +09:00
Yukihiro "Matz" Matsumoto
258cb2093c
mruby-eval: fixed receiver value in eval context; close #3072
2016-01-07 22:37:58 +09:00
Yukihiro "Matz" Matsumoto
f7afe1d82a
change mrb_run related API names; compatibility macros provided
2016-01-07 22:36:29 +09:00
Yukihiro "Matz" Matsumoto
725b3ca5a7
move KHASH_DECLARE(ht..) to mruby/hash.h; close #3073
2016-01-07 12:46:38 +09:00
Yukihiro "Matz" Matsumoto
7c82bfa7fe
mruby-sprintf to use mrb_int formatting macros; ref #3076
2016-01-07 12:23:17 +09:00
Yukihiro "Matz" Matsumoto
3cf5af681a
Merge pull request #3074 from syohex/precision-parameter-type
...
printf precision parameter must be 'int' type
2016-01-07 11:19:43 +09:00
Syohei YOSHIDA
931cc0359a
printf precision parameter must be 'int' type
...
There is a problem when MRB_INT64 is enabled.
2016-01-07 11:06:20 +09:00
Yukihiro "Matz" Matsumoto
ec711914a4
Merge pull request #3071 from ksss/symbol
...
symname_p support `!~`
2016-01-06 13:45:26 +09:00
Yukihiro "Matz" Matsumoto
20ebe9c5eb
Merge pull request #3070 from kazuho/kazuho/printf-specifiers
...
provide macro to ease using printf mrb_int
2016-01-06 12:17:05 +09:00
Kazuho Oku
cd131d18a7
define MRB_PRI? that map to PRI?NN depending on the size of mrb_int
2016-01-06 12:00:56 +09:00
ksss
af21b365d2
symname_p support !~
2016-01-06 11:59:09 +09:00
Yukihiro "Matz" Matsumoto
9145aed85e
bytes2chars() conversion to fail if target byte offset is not on the character boundary; ref #3067
...
that means String#index matches first byte of a multi-byte character. this behavior is different
from CRuby, but a compromise for mruby which does not have encoding stuffs.
2016-01-05 18:05:25 +09:00
Yukihiro "Matz" Matsumoto
aec825a64c
stack_extend before eval_under()
2016-01-04 10:22:38 +09:00
Yukihiro "Matz" Matsumoto
aa1f668b80
instance_eval should pass the receiver as a block parameter; close #3029
2016-01-02 22:01:00 +09:00
Yukihiro "Matz" Matsumoto
879e27d0f1
mirb: enlarge code buffer size to 4KB
2016-01-02 16:58:42 +09:00
Yukihiro "Matz" Matsumoto
bd462c5edc
mruby-fiber: fiber_switch() to use nesting VM when it's called from C API or mrb_funcall(); close #3056
2016-01-02 13:48:45 +09:00
Yukihiro "Matz" Matsumoto
4683b89b84
Merge pull request #3068 from kazuho/kazuho/osx-_setjmp
...
use _setjmp/_longjmp on OS X
2016-01-01 10:15:55 +09:00
Kazuho Oku
121c6e30aa
use _setjmp/_longjmp on other BSD flavors
2016-01-01 06:48:53 +09:00
Kazuho Oku
f4bb329c74
use _setjmp/_longjmp on OS X
2016-01-01 06:24:49 +09:00
Yukihiro "Matz" Matsumoto
38b9c2d308
mruby-fiber: add Fiber.yield description; close #3066
...
Fiber.yield cannot be called from #initialize which is called by
mrb_funcall(). It is mruby limitation.
2015-12-31 21:25:53 +09:00
Yukihiro "Matz" Matsumoto
31b8469bff
Merge pull request #3067 from ksss/use-memchr
...
Use memchr for performance
2015-12-31 21:20:51 +09:00
ksss
6c1b6ef7a5
Use memchr for performance
...
```ruby
s = "b"
str = ("a" * 100 + s)
t = Time.now
str.index(s)
puts Time.now - t
```
before => 0.000788
after => 0.000508
---
```ruby
s = "b"
str = ("a" * 100 * 1024 * 1024 + s)
t = Time.now
str.index(s)
puts Time.now - t
```
before => 0.225474
after => 0.008658
2015-12-31 17:52:22 +09:00
Yukihiro "Matz" Matsumoto
1d7d7062fc
__t_printstr__ may not be available for tests
2015-12-31 00:55:07 +09:00
Yukihiro "Matz" Matsumoto
3531fe179c
GC must scan env from fibers even when it's not yet copied to heap; fix #3063
2015-12-31 00:11:37 +09:00
Yukihiro "Matz" Matsumoto
4fdec33ff4
simpler t_print
2015-12-30 14:25:05 +09:00
Yukihiro "Matz" Matsumoto
ee3fa1be49
Merge pull request #3065 from kou/support-backtrace-after-method-calls
...
Support backtrace after method calls
2015-12-29 23:49:33 +09:00
Kouhei Sutou
0ebac02813
Skip backtrace related tests when backtrace isn't available
2015-12-29 23:26:31 +09:00
Kouhei Sutou
a561bdb25f
Support backtrace after method calls
...
GitHub: fix #2902 , #2917
The current implementation traverses stack to retrieve backtrace. But
stack will be changed when some operations are occurred. It means that
backtrace may be broken after some operations.
This change (1) saves the minimum information to retrieve backtrace when
exception is raised and (2) restores backtrace from the minimum
information when backtrace is needed. It reduces overhead for creating
backtrace Ruby objects.
The space for the minimum information is reused by multiple
exceptions. So memory allocation isn't occurred for each exception.
2015-12-29 20:36:12 +09:00
Yukihiro "Matz" Matsumoto
e132de9e8e
Merge pull request #3064 from kou/fix-indent
...
Fix indent
2015-12-29 14:25:10 +09:00
Kouhei Sutou
1eeeecb08a
Fix indent
2015-12-29 14:20:10 +09:00
Yukihiro "Matz" Matsumoto
d3c6fafaf3
Merge pull request #2331 from take-cheeze/struct_test
...
Improve `Struct` test.
2015-12-26 15:46:49 +09:00
Yukihiro "Matz" Matsumoto
825ced12de
remove duplicated local variable declaration
2015-12-26 11:23:28 +09:00
Yukihiro "Matz" Matsumoto
d10e304d79
Merge pull request #3062 from suzukaze/refactor-array-each
...
Refactor Array#each
2015-12-26 10:49:20 +09:00
Yukihiro "Matz" Matsumoto
6218b2e098
Merge pull request #3061 from mattn/fix-ctrl-c
...
mirb: Don't exit on Ctrl-C
2015-12-26 10:28:50 +09:00
Jun Hiroe
88076901fd
Refactor Array#each
2015-12-26 10:12:01 +09:00
kyab
1e34b12a02
mirb: Don't exit on Ctrl-C
2015-12-26 10:03:28 +09:00
Yukihiro "Matz" Matsumoto
76d44b1b48
remove execute bit from mrbgems/mruby-bin-debugger files
2015-12-26 00:07:16 +09:00
Yukihiro "Matz" Matsumoto
6e09abceaf
Merge pull request #3058 from mattn/fix-include-blocker
...
rename include blocker
2015-12-26 00:04:24 +09:00
Yasuhiro Matsumoto
f0205e1182
rename include blocker
2015-12-25 13:43:01 +09:00
Yukihiro "Matz" Matsumoto
a060bd5114
Merge pull request #3057 from yuuu/add_next_command
...
mrdb: Added 'next' command.
2015-12-23 22:35:48 +09:00
Yuhei Okazaki
887a56ba80
fix bug that doesn't stop program when execute next command.
2015-12-23 22:16:36 +09:00
Yuhei Okazaki
a08439a7c0
fixed next command's comment.
2015-12-23 22:16:36 +09:00
Yuhei Okazaki
e1cc814ec4
add next command to mrdb.
2015-12-23 22:16:36 +09:00
Yukihiro "Matz" Matsumoto
7e4a7abf5f
Merge pull request #3055 from mattn/fix-msvc-warnings
...
fix build on VS2012
2015-12-22 18:02:31 +09:00
Yasuhiro Matsumoto
7cc33af2dc
fix build on VS2012
2015-12-22 17:46:20 +09:00
Yukihiro "Matz" Matsumoto
d0727be6eb
Merge pull request #3054 from kazuho/kazuho/adjust-column-offset-in-peekc_n
...
fix miscalculation of column number in `peekc_n`
2015-12-21 18:12:06 +09:00
Kazuho Oku
adadbf5792
in peekc_n, adjust column number after calling nextc
2015-12-21 15:08:56 +09:00
Yukihiro "Matz" Matsumoto
2ca825a212
Merge pull request #3051 from zzak/ambiguous-first-argument
...
Fix "ambiguous first argument" warning
2015-12-17 01:23:34 +09:00
Zachary Scott
3f228c1da4
Fix "ambiguous first argument" warning
2015-12-17 00:12:19 +09:00
Yukihiro "Matz" Matsumoto
0720aac250
Merge pull request #3050 from remore/fix-minor-bug-about-objectspace
...
Add case statement of MRB_TT_SCLASS in mrb_obj_is_kind_of()
2015-12-16 21:04:43 +09:00
Kei Sawada
d69b5c3fc7
Add case statement of MRB_TT_SCLASS in mrb_obj_is_kind_of()
2015-12-16 15:54:03 +09:00
Yukihiro "Matz" Matsumoto
f54a98ff15
mrb_str_len_to_inum(): fixed a bug with MRB_INT_MIN conversion; fix #3048
2015-12-16 14:49:43 +09:00
Yukihiro "Matz" Matsumoto
d18c55fca7
mrb_str_len_to_inum(): fixed a bug with underscores in digits; fix #3049
2015-12-16 14:49:08 +09:00
Yukihiro "Matz" Matsumoto
80c1c60762
Merge pull request #3047 from csouls/rafactor_array_ruby_extension
...
Remove redundant conditions of Array#each in ruby extension
2015-12-16 01:03:20 +09:00
Yusuke Tanaka
d3f59db597
Remove redundant conditions of Array#each in ruby extension
2015-12-15 19:54:29 +09:00
Yukihiro "Matz" Matsumoto
2a234a93d7
mrb_str_len_to_inum(): string may not be NUL terminated; ref #3043
2015-12-14 10:59:56 +09:00
Yukihiro "Matz" Matsumoto
19c744e14d
mrb_str_len_to_inum(): fixed a bug with separating _ in the digits; ref #3043
2015-12-14 10:59:56 +09:00
Yukihiro "Matz" Matsumoto
4a6a11486c
Merge pull request #3045 from Mav7/master
...
Added YARD docs in new mruby.h
2015-12-13 15:49:43 +09:00
Ralph Desir
af33394281
Undid newline and whitespace on YARD doc
2015-12-12 20:21:53 -05:00
Ralph Desir
e27985416f
One space indentation.
2015-12-12 18:28:42 -05:00
Yukihiro "Matz" Matsumoto
26a25e1666
mrb_str_len_to_inum: should not raise "string contains null byte" error on "0x"; fix #3043
2015-12-12 16:33:48 +09:00
Yukihiro "Matz" Matsumoto
ad333cd191
mrb_str_len_to_inum: converting may not be terminated by NUL; fix #3044
2015-12-12 16:33:48 +09:00
Ralph Desir(Mav7)
4e267d74c6
Added YARD docs in new mruby.h
2015-12-11 01:52:44 -05:00
Yukihiro "Matz" Matsumoto
b9e5be6a1c
Merge pull request #3041 from zzak/travis-osx
...
Test against latest xcode
2015-12-07 15:27:33 +09:00
Zachary Scott
95edcc8f58
Test against latest xcode
...
/cc @banzaiman
https://github.com/mruby/mruby/commit/bfcc55fbf98665b33ca7110349aeb66d3ef0df1d#commitcomment-14812510
2015-12-07 15:10:58 +09:00
Yukihiro "Matz" Matsumoto
9a21aa2d3c
preserve original string for error message
2015-12-01 21:42:07 +09:00
Yukihiro "Matz" Matsumoto
ca417dac26
mrb_str_len_to_inum(): inspect string in error message
2015-12-01 21:41:53 +09:00
Yukihiro "Matz" Matsumoto
36fabe104b
new API function mrb_string_value_len()
2015-12-01 16:18:01 +09:00
Yukihiro "Matz" Matsumoto
0701236dac
mrb_str_to_inum(): should treat null byte in strings properly; fix #3040
2015-12-01 16:11:47 +09:00
Yukihiro "Matz" Matsumoto
d3a56a6949
mrb_cstr_to_inum(): should ignore trailing white spaces even when badcheck set
2015-12-01 11:14:22 +09:00
Yukihiro "Matz" Matsumoto
dbb8cf637e
mrb_str_to_inum(): should raise error when string contains null byte
2015-12-01 11:13:32 +09:00
Yukihiro "Matz" Matsumoto
9f2fca6ebe
mrb_str_to_inum(): no need to call mrb_string_value_cstr() here; ref 05411ee
2015-12-01 10:54:00 +09:00
Yukihiro "Matz" Matsumoto
05411ee15e
mrb_string_value_cstr() should not raise error for frozen strings
...
cf. http://qiita.com/tsahara@github/items/b2a442af95ac893e10a1 (Japanese).
2015-12-01 10:45:43 +09:00
Yukihiro "Matz" Matsumoto
85bd99757c
avoid comparison between signed and unsigned
2015-12-01 10:18:01 +09:00
Yukihiro "Matz" Matsumoto
1636ad41a6
C++ compiler does not like cast from pointer to enum; ref #3039
2015-12-01 10:17:35 +09:00
Yukihiro "Matz" Matsumoto
c2996514d3
should ignore block to next, break, etc. fix #3039
2015-12-01 09:38:42 +09:00
Yukihiro "Matz" Matsumoto
81a7b4039b
Merge pull request #3038 from zzak/gc-arena-docs
...
GC Arena docs pass for fixups
2015-11-30 10:34:11 +09:00
Zachary Scott
dce300517f
GC Arena docs pass for fixups
2015-11-30 10:09:43 +09:00
Yukihiro "Matz" Matsumoto
065966dae4
common.h are supposed to be included from other header, so call it with quotes; ref #3032
2015-11-28 00:10:38 +09:00
Yukihiro "Matz" Matsumoto
6f831ef21c
Merge pull request #3037 from pbosetti/mruby-time
...
Implemented round(double) function when _MSC_VER < 1800
2015-11-27 23:31:56 +09:00
Paolo Bosetti
67e3cdfa76
Implemented round(double) function within mruby-time gem, for it is missing on
...
VisualStudio compilers where _MSC_ver < 1800
2015-11-27 10:54:03 +01:00
Yukihiro "Matz" Matsumoto
9a41db6f3a
Merge pull request #2950 from mattn/mirb-file-args
...
mirb should take filename and arguments.
2015-11-27 17:49:35 +09:00
Yukihiro "Matz" Matsumoto
5c405dea3d
include changed from by quotes ("") to by brackets (<>); close #3032
2015-11-27 17:48:23 +09:00
Yukihiro "Matz" Matsumoto
2e0519de89
Merge pull request #3036 from zzak/remove-mrbtest_irep
...
Remove mrbtest irep
2015-11-26 01:03:55 +09:00
Yukihiro "Matz" Matsumoto
6dbc314ad2
Merge pull request #3035 from iij/pr-yard-mrb_str_to_cstr
...
YARD doc for mrb_str_to_cstr.
2015-11-26 01:03:08 +09:00
Yukihiro "Matz" Matsumoto
2fb12bd90e
Merge pull request #3034 from takahashim/try_convert
...
add {Array|Hash|String}.try_convert
2015-11-26 01:02:38 +09:00
Zachary Scott
1ef2faf1a6
Remove unnecessary dependencies for assert_rb codegen and test_rbireps
2015-11-24 16:33:40 +09:00
Zachary Scott
e7a301828f
Remove mrbtest_irep from mrbtest
...
If we make the core tests a dependency on the mruby-test gem,
we don't need to worry about maintaining the core test irep alone.
2015-11-24 16:32:17 +09:00
Tomoyuki Sahara
90b7ec88dc
YARD doc for mrb_str_to_cstr.
2015-11-24 16:03:58 +09:00
takahashim
621487a0cd
add {Array|Hash|String}.try_convert
2015-11-24 08:39:39 +09:00
Yukihiro "Matz" Matsumoto
625a3fee77
Merge pull request #3033 from sgnr/compiler-fix-mrb-disable-stdio-typo
...
Fix MRB_DISABLE_STDIO typo.
2015-11-24 07:44:54 +09:00
Simon Génier
058ffcb29c
Fix MRB_DISABLE_STDIO typo.
2015-11-23 11:05:33 -05:00
Yukihiro "Matz" Matsumoto
18190fa77e
Merge pull request #3030 from takahashim/nonzero
...
Support Numeric#zero? and Numeric#nonzero?
2015-11-21 00:09:17 +09:00
takahashim
40a9700ef8
support Numeric#zero? and Numeric#nonzero?
2015-11-20 23:39:45 +09:00
Yukihiro "Matz" Matsumoto
0e721efe9c
Merge pull request #3028 from sgnr/fix-mrb-disable-stdio-typo
...
Fix typo on MRB_DISABLE_STDIO.
2015-11-20 10:58:33 +09:00
Simon Génier
40f237e938
Fix typo on MRB_DISABLE_STDIO.
2015-11-19 17:03:34 -05:00
Yukihiro "Matz" Matsumoto
2aca5ab479
Merge pull request #3027 from pbosetti/master
...
Fix check for VisualStudio Version in mruby-math gem
2015-11-19 22:51:03 +09:00
Yukihiro "Matz" Matsumoto
abc724840e
formatting buffer should be bigger for negative dots; ref #3025
2015-11-19 22:49:50 +09:00
Yukihiro "Matz" Matsumoto
f974880563
binary format no longer need to preserve org_v
2015-11-19 22:49:50 +09:00
Yukihiro "Matz" Matsumoto
996417cabf
integer range check was moved to mrb_flo_to_fixnum(); ref #3025
2015-11-19 22:49:50 +09:00
Yukihiro "Matz" Matsumoto
09abdcb5e8
negative binary format should not be masked by 10bits; ref #3025
2015-11-19 22:49:50 +09:00
Yukihiro "Matz" Matsumoto
1a9b607a4d
binary sprintf should not be restricted by mrb_int size; fix #3025
2015-11-19 22:49:50 +09:00
Yukihiro "Matz" Matsumoto
8229f34098
Merge pull request #3026 from murasesyuka/bugfix/check_minus_signedint_bitshift_overflow
...
Bugfix nagative-number lshift() bit overflow
2015-11-19 22:49:27 +09:00
Paolo Bosetti
470fce5c90
Fix check for VisualStudio Version in mruby-math gem
2015-11-19 12:01:23 +01:00
murase_syuka
ef95dcd390
Bugfix nagative-number lshift() bit overflow
2015-11-18 21:37:17 +09:00
Yukihiro "Matz" Matsumoto
557ab3472a
Merge pull request #3024 from yoshiori/fix_readme_link
...
Update README.md
2015-11-18 01:27:55 +09:00
Yoshiori SHOJI
6c181fa123
Update README.md
...
Fix mrbgems doc link.
2015-11-17 10:20:39 -06:00
murase_syuka
a4d5588101
Bugfix lshift() bit overflow; close #3023
2015-11-18 01:00:46 +09:00
Yasuhiro Matsumoto
e20c2d78d1
mirb should take filename and arguments.
2015-09-12 13:23:22 +09:00
take_cheeze
e6a263a162
Raise NameError as defined in specification when Struct member isn't found.
2014-06-19 22:06:07 +09:00
take_cheeze
a2f5840b60
Add tests to Struct#[] and Struct#[]=.
2014-06-19 22:06:07 +09:00
take_cheeze
3d94022b54
Replace return value result passing with assert_* in Struct test.
2014-06-19 22:06:07 +09:00