[perl #32967] [PATCH] Re: More B bugs: svref_2object
authorStephen McCamant <smcc@mit.edu>
Tue, 28 Dec 2004 16:01:49 +0000 (08:01 -0800)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Fri, 21 Jan 2005 14:09:19 +0000 (14:09 +0000)
Message-ID: <16849.62445.116153.489478@apocalypse.OCF.Berkeley.EDU>

p4raw-id: //depot/perl@23845

ext/B/B.pm

index b70c710..4110fe2 100644 (file)
@@ -368,6 +368,10 @@ class. Apart from functions such as C<main_root>, this is the primary
 way to get an initial "handle" on an internal perl data structure
 which can then be followed with the other access methods.
 
+The returned object will only be valid as long as the underlying OPs
+and SVs continue to exist. Do not attempt to use the object after the
+underlying structures are freed.
+
 =item amagic_generation
 
 Returns the SV object corresponding to the C variable C<amagic_generation>.
@@ -523,7 +527,11 @@ The bulk of the C<B> module is the methods for accessing fields of
 these structures.
 
 Note that all access is read-only.  You cannot modify the internals by
-using this module.
+using this module. Also, note that the B::OP and B::SV objects created
+by this module are only valid for as long as the underlying objects
+exist; their creation doesn't increase the reference counts of the
+underlying objects. Trying to access the fields of a freed object will
+give incomprehensible results, or worse.
 
 =head2 SV-RELATED CLASSES