Commit Graph

231 Commits

Author SHA1 Message Date
Yukihiro "Matz" Matsumoto 877e16501c No longer need to copy argv from mrb_get_args; ref #3722 2017-06-27 22:47:26 +09:00
Yukihiro "Matz" Matsumoto c41e262667 Add write barrier to protect singleton class from GC; fix #3717 2017-06-22 01:20:22 +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 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 5513fcee22 Keep reference to mrb_context from env; fix #3619 2017-04-22 14:35:36 +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 e5b61d34f6 Fixed possible SEGV in Kernel#block_given?; ref #3593 2017-04-06 10:07:53 +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 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 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 3390020fd0 The method_missing removal condition in a76dc04a was wrong. 2017-03-02 17:59:27 +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 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 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
ksss bd72dba8c0 Kernel#local_variables: Make result array unique 2017-02-06 11:16:47 +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 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
ksss ddcb30d84b Check intern object returned by mrb_check_string_type 2017-01-06 16:27:19 +09:00
Yukihiro "Matz" Matsumoto 36f5b44578 Add new method Kernel#frozen?; ref #3370 2017-01-05 17:49:21 +09:00
ksss 5c1c002ac2 Fix segv when primitive value
Fix #3352
2016-12-25 16:52:10 +09:00
Yukihiro "Matz" Matsumoto 92c843dd07 rename prefix RBASIC_ to MRB_; ref #3340 2016-12-12 00:54:36 +09:00
Takashi Kokubun 10bb7ad693 Implement Object#freeze 2016-12-11 03:44:15 +09:00
Bouke van der Bijl 73bb30c2f4 Copy over INSTANCE_TT when duping class 2016-11-24 09:52:30 -05:00
Yukihiro "Matz" Matsumoto bfbc6b9ea4 local_variables() should not touch unshared env 2016-11-23 20:50:14 +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 c45ed46f28 macro mrb_bool() may evaluate arg multiple times; ref #3228 2016-10-24 01:30:31 +09:00
ksss 022e147b78 Kernel#respond_to? should return true|false only 2016-10-23 18:25:47 +09:00
Yasuhiro Matsumoto 8764bd282c fix public_methods(false) 2016-06-18 01:18:24 +09:00
Yukihiro "Matz" Matsumoto 5c405dea3d include changed from by quotes ("") to by brackets (<>); close #3032 2015-11-27 17:48:23 +09:00
Seba Gamboa e871b77f41 Increasing docs coverage 2015-10-20 12:16:46 -03:00
Yukihiro "Matz" Matsumoto ad1087f5ed should initialize local variable prepended to false 2015-09-23 03:27:10 +09:00
Jun Hiroe dd1fa91a66 Replace 1 with TURE macro 2015-09-18 15:51:49 +09:00
Yukihiro "Matz" Matsumoto 2550edd570 remove origin member to implement prepend from struct RClass; ref #2885
instead origin is saved in ICLASS with MRB_FLAG_IS_ORIGIN set.
2015-09-05 02:01:02 +09:00
Blaž Hrastnik a725cb9093 Include prepended methods in the instance_methods list. 2015-07-13 14:04:43 +02:00
Corey Powell 005cacf18b Additional patches to make this work 2015-07-13 14:04:42 +02:00
Yukihiro "Matz" Matsumoto b6121adc7d singleton_class should not be duped; fix #2815 2015-06-01 21:30:07 +09:00
Yukihiro "Matz" Matsumoto bd2686d82d singleton_class should not be cloned; close #2815 2015-06-01 00:13:12 +09:00
Yukihiro "Matz" Matsumoto 089f1f6c75 block_given? should work with nested block; fix #2695 close #2712 2015-01-31 13:51:25 +09:00
Yukihiro "Matz" Matsumoto 358dd61107 block_given? should return correct value when called in blocks; close #2678
avoid a loop to find parent's callinfo using mrb->c->cibase[env->cioff]
2014-12-19 19:05:27 +09:00
Yukihiro "Matz" Matsumoto 5014bfb50d block_given? should return false on top-level; ref #2678 2014-12-19 18:51:14 +09:00
Yukihiro "Matz" Matsumoto 44c29e88ae block_given did not work with nested block invocation for some cases; fix #2665 2014-12-11 00:36:18 +09:00
Yukihiro "Matz" Matsumoto 69ba4f0ed5 instance_methods etc should not include undef'ed method names; based on a patch from @cremno; fix #2613 2014-10-20 11:11:26 +09:00
Jun Hiroe f7a7426d7e Refactor mrb_obj_is_kind_of_m() in kernel.c 2014-09-02 19:40:29 +09:00
Jun Hiroe 3e40cc6974 Refactor obj_is_instance_of() in kernel.c 2014-09-02 19:40:23 +09:00
Yukihiro "Matz" Matsumoto 6c7b0d88e8 refactor valid instance variable name check 2014-09-02 16:37:40 +09:00