[前][次][番号順一覧][スレッド一覧]

ruby-changes:22668

From: nobu <ko1@a...>
Date: Tue, 21 Feb 2012 16:08:33 +0900 (JST)
Subject: [ruby-changes:22668] nobu:r34717 (trunk): * proc.c (rb_hash_proc): get wrapped pointer properly. [Bug #6048]

nobu	2012-02-21 16:08:21 +0900 (Tue, 21 Feb 2012)

  New Revision: 34717

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=34717

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

  Modified files:
    trunk/ChangeLog
    trunk/proc.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 34716)
+++ ChangeLog	(revision 34717)
@@ -1,3 +1,7 @@
+Tue Feb 21 16:08:17 2012  Nobuyoshi Nakada  <nobu@r...>
+
+	* proc.c (rb_hash_proc): get wrapped pointer properly.  [Bug #6048]
+
 Tue Feb 21 14:41:10 2012  Nobuyoshi Nakada  <nobu@r...>
 
 	* template/ruby.pc.in: added rubylibprefix, {rubylib,vendor,site}dir
Index: proc.c
===================================================================
--- proc.c	(revision 34716)
+++ proc.c	(revision 34717)
@@ -797,7 +797,8 @@
 st_index_t
 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->envval);
     return rb_hash_uint(hash, (st_index_t)proc->block.lfp >> 16);
@@ -814,10 +815,8 @@
 proc_hash(VALUE self)
 {
     st_index_t hash;
-    rb_proc_t *proc;
-    GetProcPtr(self, proc);
     hash = rb_hash_start(0);
-    hash = rb_hash_proc(hash, proc);
+    hash = rb_hash_proc(hash, self);
     hash = rb_hash_end(hash);
     return LONG2FIX(hash);
 }

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]