| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
They were checking that category 'closed' was enabled for warnings before
calling report_evil_fh(), which in turn was (correctly) checking category
'unopened'.
|
|
|
|
|
| |
It's actually only testing warnings enabled by 'closed', so test using the
tighter category.
|
|
|
|
|
| |
It was checking that category 'closed' was enabled for warnings before calling
report_evil_fh(), which in turn was (correctly) checking category 'unopened'.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a fix for RT #81230 (and more). Currently, mg_get() works around
the case where the called magic (e.g. FETCH) frees the magic SV. It does
this by unconditionally pushing the SV on the tmps stack before invoking
the method.
There are two issues with this. Firstly, it may artificially extend the
life of the SV. This was the root of the problem with #81230. There, the
DB_File code, under -T, created a tainted tied object. Accessing the
object (within FETCH as it happens), caused mg_get() to be invoked on the
object (due to the taint magic), and thus extend the life of the object.
This then caused c<untie %h if $h{k}> to give the warning
untie attempted while 1 inner references still exist.
This only became noticeable after efaf36747029c85b4d8825318cb4d485a0bb350e,
which stopped wrapping magic method calls in SAVETMPS/FREETMPS.
The second issue issue that this protection only applies to mg_get();
functions like mg_set() can still segfault if the SV is deleted.
This commit fixes both problems as follows:
First, the protection mechanism is moved out of mg_get() and into
save_magic() / restore_magic(), so that it protects more things.
Secondly, the protection is now:
* in save_magic(), SvREFCNT_inc() the SV, thus protecting it from being
freed during FETCH (or whatever)
* in restore_magic(), SvREFCNT_dec() the SV, undoing the protection
without extending the life of the SV, *except* if the refcount is
1 (ie FETCH tried to free it), then push it on the mortals stack
to extend it life a bit so our callers wont choke on it.
|
|
|
|
| |
Signed-off-by: David Golden <dagolden@cpan.org>
|
| |
|
|
|
|
| |
Previously runs would leave a GLOB(0x...) file in t/
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This trades reduced code size for an extra function call in the error path with
warnings disabled. (And removes a duplicated check for the case of taking the
error path *with* warnings enabled.)
Removing the check from Perl_do_close() does not change behaviour, as io is
NULL there, hence Perl_report_evil_fh() will always be checking WARN_UNOPENED
and setting vile to "unopened".
|
|
|
|
|
|
| |
This trades reduced code size for an extra function call in the error path with
warnings disabled. (And removes a duplicated check for the case of taking the
error path *with* warnings enabled.)
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Previously Perl_report_evil_fh()'s body was just an if/else at the top level -
a good sign that it is actually implementing two disjoint functions.
|
|
|
|
|
|
| |
It's not necessary to (also) test gv1 and gv2 before returning undef as an
error, because io1 will automatically be NULL if gv1 is NULL, and similarly
io2 if gv2 is.
|
|
|
|
|
|
|
| |
That should be gv2, not gv1. However, I believe that it's impossible to reach
the warning code, given the structure of the optree that the perl 5
implementation produces, as gv1 and gv2 will never be NULL, and GvIOn() will
always return non-NULL. (Or croak, but that won't return).
|
|
|
|
|
| |
pp_sys.c: In function ‘Perl_pp_send’:
pp_sys.c:1845: warning: operation on ‘sp’ may be undefined
|
| |
|
|
|
|
|
|
|
|
| |
Their code used to explicitly move the return value from its current position
on the stack, to the position that was top of top of the stack just before the
call was made. However, the POPBLOCK() in pp_leavesub will restore the stack
pointer, and passing G_SCALAR to call_method() will force exactly one return
value, so all of this is needless defensiveness.
|
| |
|
|
|
|
| |
It was never part of the public API, and only ever used by pp_{s,}cho{,m}p.
|
| |
|
|
|
|
|
|
| |
They share code for dealing with PVAVs, PVHVs, read only values and handling
PL_encoding. They are not part of the public API, and Google codesearch shows
no users outside the core.
|
|
|
|
| |
Pass in an SV to hold the count, rather than returning the count.
|
|
|
|
|
| |
Previously list chomp worked from last to first, whilst list chop worked from
first to last.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
The following patch clarifies what ord("") does in pod/perlfunc.pod.
From the current documentation, it's not documented what it does, and one
could guess several different things: returns zero, returns undef, returns
zero with a warning, returns undef with a warning, dies. (There's precedent
for dying: some BASIC implementations give an error if you ask for ASC("")
-- here ASC is their equivalent of our ord function.)
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Following on an IRC conversation, I've attempted to reorganize
perlhack for greater clarity. I have only cut and paste blocks
of text and amended section titles and levels. (I have not addressed
any of the numerous factual issues which remain.)
The resulting guide should be clearer for those trying to skim the
table of contents to understand what is covered in perlhack and
whether it is worth an in-depth read.
I see this change as the first step towards future improvements.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Why: The Math::BigFloat->bcmp() method returns the wrong result when the
exponent is too large to be represented exactly as a Perl numerical
scalar. In such cases, bcmp() returns 0 because it fails to distinguish
between the two exponents.
How: With this fix, bcmp() does not convert the exponents to Perl
numerical scalars, but keeps them as arbitrary precision integers, thus
returning the correct result regardsless of the number of digits in the
exponent.
Test: Two tests added. These tests fail with the old code.
Files:
- lib/Math/BigFloat.pm: New version of bcmp().
- t/bigfltpm.inc: Add two tests confirming desired behaviour.
- t/bare_mbf.t: Increment test count.
- t/bigfltpm.t: Increment test count.
- t/sub_mbf.t: Increment test count.
- t/with_sub.t Increment test count.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Why: Math::BigInt::Calc->_num() converts a big integer (in the internal
format) to a Perl scalar. If the big integer is too large to be
represented as a Perl scalar, it might return a Perl scalar numeric
"nan", rather than "inf". The reason is that the current algorithm might
multiply "inf" by "0", giving a "nan" which propagates. The following
example illustrates the bug:
perl -MMath::BigInt=lib,Calc -wle \
'print Math::BigInt->new("1e999999")->numify()'
How: This fix computes the output in a different way, never multiply
"inf" by "0".
Test: It is not obvious to me how to test this automatically in a
portable way, since Perl has no standard way of stringifying a scalar
numeric infinity. However the desired behaviour is verified manually and
no existing tests fail with the new code.
|
| |
|
|
|
|
| |
Signed-off-by: Chris 'BinGOs' Williams <chris@bingosnet.co.uk>
|
|
|
|
| |
Signed-off-by: Chris 'BinGOs' Williams <chris@bingosnet.co.uk>
|
|
|
|
| |
If unquoted, it may throw a warning when threads.pm can't be loaded.
|
|
|
|
|
|
|
|
|
|
|
|
| |
[DELTA]
$Revision: 2.41 $ $Date: 2010/12/23 11:05:58 $
lib/Encode/MIME/Header.pm
Applied: RT#63387 encode of MIME-Header inserts too much whitespace
http://rt.cpan.org/Ticket/Display.html?id=63387
t/Aliases.t lib/Encode/Alias.pm
Applied: RT#63286: Various Encode::Alias improvements
http://rt.cpan.org/Ticket/Display.html?id=63286
|
|
|
|
|
| |
use.perl.org is dead. www.cpan.org is maintained by Ask, not Jarkko
any more. Separate CPAN/src and www.cpan.org issues into distinct steps.
|
|
|
|
|
|
|
| |
The refactoring of 3b0fc154d4e77cfb inadvertently introduced a bug
in Perl_is_utf8_char() and its callers, such as Perl_is_utf8_string(),
whereby the beyond-Unicode characters 0x140000 to 0x1fffff were no longer
recognised as valid.
|
| |
|
| |
|
|
|
|
|
|
| |
They might have served a purpose in the original files, but Nicholas
and Zefram expressed their concern that in the generated files, these
tags are misleading and unneeded.
|
| |
|
|
|
|
| |
cbeaa1895 removed the reference to $perlpath
|
|
|
|
|
| |
The field is missing in the headers included with VC6, but
commit 1ab9ebc11 adds it in our win32/include/sys/socket.h.
|
| |
|
| |
|
|
|
|
|
| |
It's present on recent versions, but not all versions. Follow-up
to f53580fec42f3b12264ee27b756dec257c0bb77a.
|