develooper Front page | perl.perl5.porters | Postings from April 2014

[perl #116925] document/publicize THINKFIRST

Thread Next
Tony Cook via RT
April 21, 2014 02:04
[perl #116925] document/publicize THINKFIRST
Message ID:
On Wed Apr 16 18:51:10 2014, tonyc wrote:
> 1) offset <= SvCUR() - if the wrapped function does read needlen
> bytes, some of the data is going to be uninitialized.
> 2) offset > SvCUR() - the wrapped function is going to receive
> uninitialized content, but the caller is also going to receiver
> uninitialized data.

I went through some drafts trying to address this, but I think examples like
this need to stay simple rather than trying to cover every possible use of
the APIs.

So all I've added is a check that offset <= len so we don't return undefined content back to the caller.

I don't think it's necessary to document here that the extra memory allocated by SvGROW() is undefined, since we don't say what it is initialized it, the caller shouldn't be making an assumptions about it.


via perlbug:  queue: perl5 status: open

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About