Fix rb_digest_base_become (ruby-core:428)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2789 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
ec43854aa6
commit
869159006a
@ -147,15 +147,14 @@ rb_digest_base_become(copy, obj)
|
|||||||
{
|
{
|
||||||
algo_t *algo;
|
algo_t *algo;
|
||||||
void *pctx1, *pctx2;
|
void *pctx1, *pctx2;
|
||||||
VALUE klass;
|
|
||||||
|
|
||||||
if (copy = obj) return copy;
|
if (copy = obj) return copy;
|
||||||
rb_check_frozen(copy);
|
rb_check_frozen(copy);
|
||||||
algo = get_digest_base_metadata(CLASS_OF(klass));
|
algo = get_digest_base_metadata(CLASS_OF(copy));
|
||||||
if (algo != get_digest_base_metadata(CLASS_OF(obj))) {
|
if (algo != get_digest_base_metadata(CLASS_OF(obj))) {
|
||||||
rb_raise(rb_eTypeError, "wrong argument class");
|
rb_raise(rb_eTypeError, "wrong argument class");
|
||||||
}
|
}
|
||||||
Data_Get_Struct(copy, void, pctx1);
|
Data_Get_Struct(obj, void, pctx1);
|
||||||
Data_Get_Struct(copy, void, pctx2);
|
Data_Get_Struct(copy, void, pctx2);
|
||||||
memcpy(pctx2, pctx1, algo->ctx_size);
|
memcpy(pctx2, pctx1, algo->ctx_size);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user