27 Commits

Author SHA1 Message Date
Yukihiro "Matz" Matsumoto 7653bdd05e test/codegen.rb: call #remove_const via #__send__ to skip private check 2025-03-07 17:17:39 +09:00
Yukihiro "Matz" Matsumoto a67f32561f test/t/codegen.rb: test 127 arguments with break not next
In addition, avoid using undefined constant `A` because it terminates
actual execution by `NameError`.
2023-08-30 18:28:59 +09:00
Yukihiro "Matz" Matsumoto b80e0ef742 Move Kernel#send to mruby-metaprog gem.
But `BasicObject#__send__` is still available from the core.
2018-09-01 11:20:30 +09:00
Yukihiro "Matz" Matsumoto e471d37ca5 Separate meta-programming features to mruby-metaprog gem.
We assume meta-programming is less used in embedded environments.
We have moved following methods:

 * Kernel module
   global_variables, local_variables, singleton_class,
   instance_variables, instance_variables_defined?, instance_variable_get,
   instance_variable_set, methods, private_methods, public_methods,
   protected_methods, singleton_methods, define_singleton_methods

 * Module class
   class_variables, class_variables_defined?, class_variable_get,
   class_variable_set, remove_class_variable, included_modules,
   instance_methods, remove_method, method_removed, constants

 * Module class methods
   constants, nesting

Note:
Following meta-programming methods are kept in the core:

 * Module class
   alias_method, undef_method, ancestors, const_defined?, const_get,
   const_set, remove_const, method_defined?, define_method

 * Toplevel object
   define_method

`mruby-metaprog` gem is linked by default (specified in default.gembox).
When it is removed, it will save 40KB (stripped:8KB) on x86-64
environment last time I measured.
2018-08-30 22:30:36 +09:00
Christopher Aue 3366894a40 Fixed register windows of OP_SENDs generated by NODE_{DREGX,REGX}; ref #3783 2017-08-23 18:16:05 +02:00
Christopher Aue 499498a6a7 Tested register windows of OP_SENDs generated by NODE_{DXSTR,XSTR}; ref #3783 2017-08-23 18:15:54 +02:00
Christopher Aue 84d8ecc1d7 Fixed register windows of OP_SENDs generated by NODE_OP_ASGN; ref #3783 2017-08-23 18:15:44 +02:00
Christopher Aue 1221f7676e Fixed register windows of OP_SENDs generated by NODE_{FOR,SYMBOLS}; ref #3783 2017-08-23 18:15:27 +02:00
Christopher Aue c040c8d92b Tested register windows of OP_SENDs generated by NODE_{RESCUE,HASH,ALIAS}; ref #3783 2017-08-23 18:15:08 +02:00
Christopher Aue c6596cf26a Fixed register windows of OP_SENDs generated by NODE_{SCALL,CASE,YIELD,UNDEF}; ref #3783 2017-08-23 18:12:35 +02: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 e0fbf25f90 Remove tests which can not be compiled on CRuby. 2017-06-02 11:51:59 +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
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
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
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 fe362c1f26 Fix segfault when using result of rest assignment
Reported by https://hackerone.com/haquaman
2016-12-01 15:49:36 -05:00
Yukihiro "Matz" Matsumoto 55842c5a34 resolve conflict; ref #3279 2016-11-25 09:33:20 +09:00
Yukihiro "Matz" Matsumoto 30f12ba4bc resolve conflict; ref #3283 2016-11-25 09:27:24 +09:00
Yukihiro "Matz" Matsumoto cc2786c84e resolve conflict; ref #3285 2016-11-25 09:25:51 +09:00
Yukihiro "Matz" Matsumoto 0b4017fd69 resolve conflict; ref #3286 2016-11-25 09:23:47 +09:00
Francis Bogsanyi 964427f82c Fix unsafe peephole optimization
Reported by https://hackerone.com/dkasak
2016-11-24 10:32:34 -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 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 73e4f069be Fix nested empty heredoc causing segfault
As reported by https://hackerone.com/jpenalbae
2016-11-24 09:54:18 -05:00