diff options
author | Daniel Dragan <bulk88@hotmail.com> | 2012-12-11 14:01:54 -0500 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2012-12-11 16:23:59 -0800 |
commit | 4b1e7f06143ab88e9b000eed23ae71e75b7c24b8 (patch) | |
tree | edc372a70959319a44c89afad2386c72286ec768 /sv.h | |
parent | d2192f4f82773968f8eb344c3b3b3836b271aa06 (diff) | |
download | perl-4b1e7f06143ab88e9b000eed23ae71e75b7c24b8.tar.gz |
better POD for mg_get and SvGROW
SvGROW unconditionally derefs SvANY to check SvLEN. A crash occurs if the
sv is SVt_NULL. Also mg_get uses SvMAGIC which also has the same problem.
Rather than having people finding these properties out by trial and error,
document them. There is no sense in adding type checks since these 2 calls
have been had sv type restrictions since probably day 1 and for
performance reason. Anyone who hit the restrictions would have either
fixed their code immediately, or abandoned using XS. I observed someone
abandoning XS in the field over these undocumented restrictions.
Diffstat (limited to 'sv.h')
-rw-r--r-- | sv.h | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -2010,7 +2010,8 @@ has been loaded. Expands the character buffer in the SV so that it has room for the indicated number of bytes (remember to reserve space for an extra trailing NUL character). Calls C<sv_grow> to perform the expansion if necessary. -Returns a pointer to the character buffer. +Returns a pointer to the character buffer. SV must be of type >= SVt_PV. One +alternative is to call C<sv_grow> if you are not sure of the type of SV. =cut */ |