diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-02 07:27:22 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-02 07:27:22 +0000 |
commit | 2a66cc554db6263bc04c804ad62750497c26a772 (patch) | |
tree | 4c3eddec025ca9be4434af4d1de4264caa0647cf /object.c | |
parent | a497ed37332948baf3433210e46c7bb71dfe33a6 (diff) | |
download | ruby-2a66cc554db6263bc04c804ad62750497c26a772.tar.gz |
encoding.c: defer finding encoding
* encoding.c (enc_m_loader): defer finding encoding object not to
be infected by marshal source. [ruby-core:71793] [Bug #11760]
* marshal.c (r_object0): enable compatible loader on USERDEF
class. the loader function is called with the class itself,
instead of an allocated object, and the loaded data.
* marshal.c (compat_allocator_table): intialize
compat_allocator_tbl on demand.
* object.c (rb_undefined_alloc): extract from rb_obj_alloc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52856 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'object.c')
-rw-r--r-- | object.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -1770,6 +1770,13 @@ rb_class_initialize(int argc, VALUE *argv, VALUE klass) return klass; } +void +rb_undefined_alloc(VALUE klass) +{ + rb_raise(rb_eTypeError, "allocator undefined for %"PRIsVALUE, + klass); +} + /* * call-seq: * class.allocate() -> obj @@ -1806,8 +1813,7 @@ rb_obj_alloc(VALUE klass) } allocator = rb_get_alloc_func(klass); if (!allocator) { - rb_raise(rb_eTypeError, "allocator undefined for %"PRIsVALUE, - klass); + rb_undefined_alloc(klass); } RUBY_DTRACE_CREATE_HOOK(OBJECT, rb_class2name(klass)); |