summaryrefslogtreecommitdiff
path: root/marshal.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-07-31 08:42:44 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-07-31 08:42:44 +0000
commit5b9afca5e435f37c7affce56e81e6bc20a5d8b3c (patch)
tree2c833c1b565733ed271fd9071f68150d40142923 /marshal.c
parent7126624b4effe49919e35224054cc48e86716f39 (diff)
* numeric.c (rb_num_coerce_relop): export function.
* marshal.c (w_object): check has been dropped. "_dump must return string." [ruby-dev:21024] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'marshal.c')
-rw-r--r--marshal.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/marshal.c b/marshal.c
index eeed643..c5f68bd 100644
--- a/marshal.c
+++ b/marshal.c
@@ -493,6 +493,9 @@ w_object(obj, arg, limit)
VALUE v;
v = rb_funcall(obj, s_dump, 1, INT2NUM(limit));
+ if (TYPE(v) != T_STRING) {
+ rb_raise(rb_eTypeError, "_dump() must return string");
+ }
w_class(TYPE_USERDEF, obj, arg);
w_bytes(RSTRING(v)->ptr, RSTRING(v)->len, arg);
if (ivtbl) w_ivar(ivtbl, &c_arg);