diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-03-25 03:23:43 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-03-25 03:23:43 +0000 |
commit | 217f599a1e1c09618b0ebeffb34be790f70b8c68 (patch) | |
tree | 1cf6c97d0fff0928365e6d4cae5fc4e535569238 /class.c | |
parent | 19a1f70364ccabaace321d492d35a99ad9053423 (diff) | |
download | ruby-217f599a1e1c09618b0ebeffb34be790f70b8c68.tar.gz |
class.c: prohibit refinement module
* class.c (ensure_includable): cannot include refinement
module, or the type and the class do not match.
[ruby-core:79632] [Bug #13236]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58083 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'class.c')
-rw-r--r-- | class.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -854,6 +854,9 @@ ensure_includable(VALUE klass, VALUE module) { rb_frozen_class_p(klass); Check_Type(module, T_MODULE); + if (!NIL_P(rb_refinement_module_get_refined_class(module))) { + rb_raise(rb_eArgError, "refinement module is not allowed"); + } OBJ_INFECT(klass, module); } |