$NetBSD: patch-ah,v 1.1 2001/12/30 16:21:52 taca Exp $ --- lib/weakref.rb.orig Thu Jul 27 18:49:33 2000 +++ lib/weakref.rb @@ -60,7 +60,11 @@ unless ID_MAP[@__id] raise RefError, "Illegal Reference - probably recycled", caller(2) end - ObjectSpace._id2ref(@__id) + begin + ObjectSpace._id2ref(@__id) + rescue RangeError + raise RefError, "Illegal Reference - probably recycled", caller(2) + end end def weakref_alive?