Skip to content

Commit

Permalink
* proc.c (rb_hash_proc): get wrapped pointer properly. [Bug ruby#6048]
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34717 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nobu committed Feb 21, 2012
1 parent a5e49f9 commit 2e733be
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
@@ -1,3 +1,7 @@
Tue Feb 21 16:08:17 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>

* proc.c (rb_hash_proc): get wrapped pointer properly. [Bug #6048]

Tue Feb 21 14:41:10 2012 Nobuyoshi Nakada <nobu@ruby-lang.org> Tue Feb 21 14:41:10 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>


* template/ruby.pc.in: added rubylibprefix, {rubylib,vendor,site}dir * template/ruby.pc.in: added rubylibprefix, {rubylib,vendor,site}dir
Expand Down
7 changes: 3 additions & 4 deletions proc.c
Expand Up @@ -797,7 +797,8 @@ proc_eq(VALUE self, VALUE other)
st_index_t st_index_t
rb_hash_proc(st_index_t hash, VALUE prc) rb_hash_proc(st_index_t hash, VALUE prc)
{ {
const rb_proc_t *proc = (const rb_proc_t *)prc; rb_proc_t *proc;
GetProcPtr(prc, proc);
hash = rb_hash_uint(hash, (st_index_t)proc->block.iseq); hash = rb_hash_uint(hash, (st_index_t)proc->block.iseq);
hash = rb_hash_uint(hash, (st_index_t)proc->envval); hash = rb_hash_uint(hash, (st_index_t)proc->envval);
return rb_hash_uint(hash, (st_index_t)proc->block.lfp >> 16); return rb_hash_uint(hash, (st_index_t)proc->block.lfp >> 16);
Expand All @@ -814,10 +815,8 @@ static VALUE
proc_hash(VALUE self) proc_hash(VALUE self)
{ {
st_index_t hash; st_index_t hash;
rb_proc_t *proc;
GetProcPtr(self, proc);
hash = rb_hash_start(0); hash = rb_hash_start(0);
hash = rb_hash_proc(hash, proc); hash = rb_hash_proc(hash, self);
hash = rb_hash_end(hash); hash = rb_hash_end(hash);
return LONG2FIX(hash); return LONG2FIX(hash);
} }
Expand Down

0 comments on commit 2e733be

Please sign in to comment.