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