зеркало из https://github.com/github/ruby.git
* ext/digest/digest.c (rb_digest_instance_method_unimpl): Do not
call rb_inspect() on an object that does not implement necessary methods; reported by NaHi. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
80b54214b2
Коммит
e6f670242c
|
@ -1,3 +1,9 @@
|
||||||
|
Wed Nov 25 19:29:05 2009 Akinori MUSHA <knu@iDaemons.org>
|
||||||
|
|
||||||
|
* ext/digest/digest.c (rb_digest_instance_method_unimpl): Do not
|
||||||
|
call rb_inspect() on an object that does not implement necessary
|
||||||
|
methods; reported by NaHi.
|
||||||
|
|
||||||
Wed Nov 25 19:30:30 2009 Martin Duerst <duerst@it.aoyama.ac.jp>
|
Wed Nov 25 19:30:30 2009 Martin Duerst <duerst@it.aoyama.ac.jp>
|
||||||
|
|
||||||
* transcode.c: Added a check for an internal error
|
* transcode.c: Added a check for an internal error
|
||||||
|
|
|
@ -83,6 +83,15 @@ rb_digest_s_hexencode(VALUE klass, VALUE str)
|
||||||
* object to calculate message digest values.
|
* object to calculate message digest values.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
static void
|
||||||
|
rb_digest_instance_method_unimpl(VALUE self, const char *method)
|
||||||
|
{
|
||||||
|
VALUE klass = rb_obj_class(self);
|
||||||
|
|
||||||
|
rb_raise(rb_eRuntimeError, "%s does not implement %s()",
|
||||||
|
rb_obj_classname(self), method);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* digest_obj.update(string) -> digest_obj
|
* digest_obj.update(string) -> digest_obj
|
||||||
|
@ -97,7 +106,7 @@ rb_digest_s_hexencode(VALUE klass, VALUE str)
|
||||||
static VALUE
|
static VALUE
|
||||||
rb_digest_instance_update(VALUE self, VALUE str)
|
rb_digest_instance_update(VALUE self, VALUE str)
|
||||||
{
|
{
|
||||||
rb_raise(rb_eRuntimeError, "%s does not implement update()", RSTRING_PTR(rb_inspect(self)));
|
rb_digest_instance_method_unimpl(self, "update");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -115,7 +124,7 @@ rb_digest_instance_update(VALUE self, VALUE str)
|
||||||
static VALUE
|
static VALUE
|
||||||
rb_digest_instance_finish(VALUE self)
|
rb_digest_instance_finish(VALUE self)
|
||||||
{
|
{
|
||||||
rb_raise(rb_eRuntimeError, "%s does not implement finish()", RSTRING_PTR(rb_inspect(self)));
|
rb_digest_instance_method_unimpl(self, "finish");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -129,7 +138,7 @@ rb_digest_instance_finish(VALUE self)
|
||||||
static VALUE
|
static VALUE
|
||||||
rb_digest_instance_reset(VALUE self)
|
rb_digest_instance_reset(VALUE self)
|
||||||
{
|
{
|
||||||
rb_raise(rb_eRuntimeError, "%s does not implement reset()", RSTRING_PTR(rb_inspect(self)));
|
rb_digest_instance_method_unimpl(self, "reset");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -358,7 +367,7 @@ rb_digest_instance_length(VALUE self)
|
||||||
static VALUE
|
static VALUE
|
||||||
rb_digest_instance_block_length(VALUE self)
|
rb_digest_instance_block_length(VALUE self)
|
||||||
{
|
{
|
||||||
rb_raise(rb_eRuntimeError, "%s does not implement block_length()", RSTRING_PTR(rb_inspect(self)));
|
rb_digest_instance_method_unimpl(self, "block_length");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Загрузка…
Ссылка в новой задаче