Commit Graph

8151 Commits

Author SHA1 Message Date
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