| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
This patch stops y from calling get-magic twice. (This has caused
double magick since as far back as 5.6.2.)
|
|
|
|
|
|
| |
This fixes m and s. It modifies pp_regcomp to avoid extra magic. It
also corrects a bug in sv_catsv_flags, which would still call
mg_get(ssv) even without the SV_GMAGIC flag set.
|
|
|
|
|
|
| |
This fixes ! by changing sv_2bool to sv_2bool_flags (with a macro
wrapper) and adding SvTRUE_nomg. It also corrects the docs that state
incorrectly that SvTRUE does not handle magic.
|
|
|
|
|
|
| |
This patch changes sv_eq, sv_cmp, sv_cmp_locale and sv_collxfrm
to _flags forms, with macros under the old names for sv_eq and
sv_collxfrm, but functions for sv_cmp* since pp_sort.c needs them.
|
|
|
|
|
|
| |
Fix all the tests that were using quotes, and (by implication) working
because barewords are treated as strings, and one-liners aren't run under
strict.
|
|
|
|
|
| |
test.pl uses "" for command line quoting on Win32, VMS and NetWare, '' on *nix.
Hence what "works on my machine" on *nix may not work elsewhere.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The first time gv_fetchfile is called for a particular file, it
creates the glob and, if debugging is on, creates an AV. If the glob
already exists (i.e., in subsequent calls), the AV is not created. The
attached patch moves the check for debugging mode and the creation of
the AV outside the if-block that checks whether the glob exists.
This bug seems to have existed for a very long time and has been
intermittent. It seems that many different things can change the order
in which #!perl -d and gv_fetchfile occur. Whether compilation options
affect it I do not know. I can reproduce it in 5.6.2, 5.8.[123456]
(non-threaded) and 5.11.3 (both threaded and non-threaded), but not
5.8.[789] or 5.10.[01] (threaded).
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This case can be reduced to:
eval "UNITCHECK{ eval 0 }"
(eval 0 triggers the bug more reliably than eval ''.)
The inner eval clobbers PL_eval_start, so when the UNITCHECK finishes,
the outer eval tries to call the inner eval’s code, which has been
freed already.
This commit saves PL_eval_start and restores it after UNITCHECK.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds recognition of these modifiers, with appropriate action
for d and l. u does nothing useful yet. This allows for the
interpolation of a regex into another one without losing the character
set semantics that it was compiled with, as for the first time, the
semantics is now specified in the stringification as one of these
modifiers.
To this end, it allocates an unused bit in the structures. The off-
sets change so as to not disturb other bits.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
t/base/rs.t needs to @INClude the lib directory before requiring
PerlIO::scalar, even if the require is in an eval, because it will
otherwise pick up a previously-installed copy.
Since 87b9e1600 (Eliminate PL_* accessor functions under ithreads), a
binary-incompatible change, I’ve been getting these errors:
t/base/rs......................................................dyld: lazy symbol binding failed: Symbol not found: _Perl_Istack_sp_ptr
Referenced from: /usr/local/lib/perl5/5.13.5/darwin-thread-multi-2level/auto/PerlIO/scalar/scalar.bundle
Expected in: dynamic lookup
dyld: Symbol not found: _Perl_Istack_sp_ptr
Referenced from: /usr/local/lib/perl5/5.13.5/darwin-thread-multi-2level/auto/PerlIO/scalar/scalar.bundle
Expected in: dynamic lookup
FAILED--no leader found
Failed a basic test (base/rs.t) -- cannot continue.
make: *** [test] Error 255
|
|
|
|
|
|
|
|
|
|
|
|
| |
$text =~ ( 1 ? /phoo/ : /bear/)
used to be constant-folded to
$text =~ /phoo/
This patch solves the problem by marking match and subst ops as
OPf_SPECIAL during constant folding, so the =~ operator can tell not
to take possession of it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
$ perl -le '$_="CCCGGG"; s!.!@a{print("[$&]"),/./}!g'
[C]
[C]
[C]
[C]
[C]
[C]
What’s happening is that the s/// does not reset PL_curpm for each
iteration, because it doesn’t usually have to.
The RHS’s scoping takes care of it most of the time. This happens with
the /e modifier and with @{...}.
In this example, though, we have a subscript, not a block. This sub-
script is in the same scope as the s/// itself.
The assumption that the substitution operator will never have to reset
PL_curpm itself appears to be incorrect. This fixes it.
|
| |
|
|
|
|
|
| |
Reset cx in pp_sort before POPSUB, as the pointer may no
longer be valid.
|
|
|
|
|
|
|
|
| |
This test was producing spurious output to stderr when not under
git control (e.g. a release tarball):
fatal: Not a git repository (or any parent up to mount parent )
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently perl does 3 major scans of the SV arenas, so the action of
perl_destroy() is a bit like this:
for (all arena SVs) {
if (its a ref to an object)
undef the ref (and thus probably free the object)
}
for (all arena SVs) {
if (it's a typeglob and at least one of its slots holds an object) {
set SVf_BREAK on the gv
SvREFCNT_dec(gv)
}
}
return if $PERL_DESTRUCT_LEVEL < 1;
PL_in_clean_all = 1
for (all arena SVs) {
set SVf_BREAK on the sv
SvREFCNT_dec(sv)
}
The second scan is problematic, in that by randomly zapping GVs, it can
leave dangling pointers to freed GVs. This is while perl-level destructors
may still be called, meaning perl users can see corrupted state.
Note also that at this point PL_in_clean_all hasn't been set, so sv_free()
may put out 'Attempt to free unreferenced scalar' warnings.
This commit fixes this by only freeing the affected slots of the GV,
rather than freeing the GV itself. Thus makes it more like the first pass,
which undefs RVs, and ensures no dangling refs.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds (?^...) to signify to use the default regex modifiers for the
cluster or embedded pattern-match modifier change. The major purpose of
this is to simplify regex stringification, so that "^" is output in
place of "-xism". As a result, the stringification will not change in
the future when new regex modifiers are added, so tests, etc. that rely
on a particular stringification will have to change now, but never
again.
Code that needs to work properly with both old- and new-style regexes
can use something like the following:
# Accept both old and new-style stringification
my $modifiers = (qr/foobar/ =~ /\Q(?^/) ? '^' : '-xism';
This construct is Ben Morrow's idea.
|
|
|
|
| |
We can now set PERL_CORE again when running its tests.
|
|
|
|
| |
These would fail when smokes tested under unicode locales.
|
|
|
|
|
|
|
|
|
|
| |
8 and 9 are not treated as alphas in parsing as opposed to illegal
octals.
This also adds tests to verify that 1-3 digits work in char classes.
I created an isOCTAL macro in case that lookup gets moved to a bit
field, as I plan to do later, for speed.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Not very elegant, but it avoids using $^W or warnings.pm.
|
|
|
|
|
| |
Lots of unnecessary test boilerplate has been removed, allowing us to remove the
dist from both %abs and %temp_no_core in t/TEST.
|
|
|
|
| |
(For example: m//and print "foo")
|
|
|
|
| |
Check that a Regex object which was previous copied and weaken'ed can be used in another pattern.
|
|
|
|
|
|
|
|
|
| |
This restores the perl 5.10/12 behaviour, making open treat \$foo as a
scalar reference if it is a glob copy (SvFAKE).
It also fixes an existing assertion failure that the test now trig-
gers. PerlIOScalar_pushed was not downgrading the sv before set-
ting SvCUR.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix for #31865: weird results from reverse( %x = reverse %h )
Basically, anything of the form
@a = %h = (list with some duplicate keys)
may have left @a containing weird and/or freed values.
There was a partial fix for this with ca65944e, but it was broken
(it did one big block move on the stack at the end to remove duplicates,
but duplicates weren't necessarily all in one block.)
The new fix is a two-stage process. First, while pulling key/value pairs
of the stack and assigning them to the hash, each key/val pair is written
back to the stack - possibly at a lower position if there are duplicates to
be skipped.
Finally at the end if any duplicates have been detected, then in list
context, a single pass is made through the stack, and for each key/val
pair, the key is looked up and the val on the stack is overwritten with
the new value (replacing possibly freed or other garbage values).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Change the &Internals::* functions that use references in their
prototypes to check if the argument is SvROK() before calling SvRV().
If the function is called as Internals::FOO() perl does this check for
us, but prototypes are bypassed on &Internals::FOO() so we still have
to check this manually.
This fixes [perl #77776], this bug was present in 5.10.x, 5.12.x, and
probably all earlier perl versions that had these functions, but I
haven't tested that.
I'm adding a new test file (t/lib/universal.t) to test universal.c
functions as part of this patch. The testing for Internal::* in t/ was
and is very sparse, but before universal.t there was no obvious place
to put these tests.
Signed-off-by: Ævar Arnfjörð Bjarmason <avar@cpan.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1. &warnings::register is added as the public mechanism for adding
new warning categories, rather than warnings::register::import
knowing about warnings's internals
2. warnings::register::import is updated to use &warnings::register
3. warnings::register::import can take a list of subcategories
The upshot is that you can now write:
package MyTool;
use warnings::register qw(io typos);
warnings::warnif('MyTool::io', $message);
...and tools that register new warnings categories do not need to cargo cult
code from warnings/register.pm
|
|
|
|
|
|
|
| |
This was only needed for testing in the core, when the core's tests all ran
the top level t/ directory. Without this getting in the way, we don't need
t/TEST and t/harness to run the tests with absolute paths in @INC. Testing in
the CPAN distribution is unaffected.
|
|
|
|
|
|
|
| |
This was only needed for testing in the core, when the core's tests all ran in
the top level t/ directory. Without this getting in the way, we don't need
t/TEST and t/harness to run the tests with absolute paths in @INC. Testing in
the CPAN distribution is unaffected.
|
| |
|
|
|
|
|
| |
This was forgotten in the move from cpan/ to dist/ in commit
c510e33d30368bc5440f1651f6b31f73d2354eba.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
fix for [perl #21469]:
since the GP may be pulled from under us and freed, coredumps and strange
things can happen.
Fix this by storing a pointer to the GV in the loop block, rather than a
pointer to the GvSV slot. The ITHREADS variant already stores GV rather
than than &GvSV; extend this to non-threaded builds too.
Also, for both threaded and non-threaded, it used to push &GvSV on the
save stack. Fix this by introducing a new save type, SAVEt_GVSV.
This behaves similarly to SAVEt_SV, but without magic get/set.
This means that
for $package_var (...)
is now close in behaviour to
local $package_var = ...
(except for the magic bit).
|
|
|
|
|
|
|
|
|
|
| |
This makes a qw(...) list literal a distinct token type for the
parser, where previously it was munged into a "(",THING,")" sequence.
The change means that qw(...) can't accidentally supply parens to parts
of the grammar that want real parens. Due to many bits of code taking
advantage of that by "foreach my $x qw(...) {}", this patch also includes
a hack to coerce qw(...) to the old-style parenthesised THING, emitting
a deprecation warning along the way.
|
|
|
|
|
|
|
|
|
| |
Commit e5c69c9b added the test to dist/constant/t/constant.t, probably because
the bug was initially reported in combination with constant.pm. However, it was
a core bug in gv_init and can be reproduced easily without constant.pm.
With this change dist/constant can be safely synced back to CPAN without having
to SKIP or TODO this particular test.
|
| |
|
|
|
|
|
|
| |
ref_array_or_hash did not take aslice or hslice OPs into account; wrap
them in an anonlist so that smart matching has a reference as it
expects.
|
|
|
|
|
|
|
|
|
| |
[perl #9466]
pp_postinc and pp_postdec used a pad TARG to return a copy of the
original value. When that value was a reference, it meant a copy
of the reference would hang out in the pad forever and so the referent
would leak. Fix this by using a mortal instead.
|
|
|
|
|
| |
Stop magic applied to $!, %SIG, et al. from applying to similarly-
named variables in other packages.
|
| |
|
| |
|
| |
|
|
|
|
| |
Not every operating system has /proc/self/exe
|