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
Craig Lehmann
3de2da409b
Avoid call to_s during backtrace traversal
2017-05-15 20:40:47 -04:00
ksss
bdb36b3404
Make string embad from shared
2017-05-13 22:44:52 +09:00
ksss
8cba9a9e42
Adjust to the optimum type
2017-05-05 14:20:21 +09: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
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
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
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
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
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
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
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
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
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
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