summaryrefslogtreecommitdiff
path: root/marshal.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-03-26 02:20:52 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-03-26 02:20:52 (GMT)
commit3935f2ae6e315e4e163e9891fe5d50ae606827ac (patch)
treecd06163e1bdef374ac4366a75a8e49450d7b538f /marshal.c
parent1dd527012b5da0f7d84986a201c3b7f834adef78 (diff)
marshal.c: undumpable hidden objects
* marshal.c (w_object): internal objects are not dumpable. [ruby-core:61677] [Bug #9674] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'marshal.c')
-rw-r--r--marshal.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/marshal.c b/marshal.c
index 7772b4c..e8791d9 100644
--- a/marshal.c
+++ b/marshal.c
@@ -677,6 +677,11 @@ w_object(VALUE obj, struct dump_arg *arg, int limit)
else {
VALUE v;
+ if (!RBASIC_CLASS(obj)) {
+ rb_raise(rb_eTypeError, "can't dump internal %s",
+ rb_builtin_type_name(BUILTIN_TYPE(obj)));
+ }
+
arg->infection |= (int)FL_TEST(obj, MARSHAL_INFECTION);
if (rb_obj_respond_to(obj, s_mdump, TRUE)) {