| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit makes CORE::glob bypassing glob overrides.
A side effect of the fix is that, with the default glob implementa-
tion, undefining *CORE::GLOBAL::glob no longer results in an ‘unde-
fined subroutine’ error.
Another side effect is that compilation of a glob op no longer assumes
that the loading of File::Glob will create the *CORE::GLOB::glob type-
glob. ‘++$INC{"File/Glob.pm"}; sub File::Glob::csh_glob; eval '<*>';’
used to crash.
This is accomplished using a mechanism similar to lock() and
threads::shared. There is a new PL_globhook interpreter varia-
ble that pp_glob calls when there is no override present. Thus,
File::Glob (which is supposed to be transparent, as it *is* the
built-in implementation) no longer interferes with the user mechanism
for overriding glob.
This removes one tier from the five or so hacks that constitute glob’s
implementation, and which work together to make it one of the buggiest
and most inconsistent areas of Perl.
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
$[ remains as a variable. It no longer has compile-time magic.
At runtime, it always reads as zero, accepts a write of zero, but dies
on writing any other value.
|
|
|
|
|
|
|
| |
This is necessary after 046cc26cf77f76bc63fd4d206fef560054f5d298,
which removed the special handling in vmsish.h. Building with
threads masked the need for the current change because reentr.h
also does the equivalent.
|
|
|
|
|
|
|
|
|
|
|
|
| |
grep.cpan.me and Google's codesearch find no use of WITH_THR or WITH_THX.
WITH_THX() was added in June 1999 in cea2e8a9dd23747f, and the last user
eliminated with 0b250b9ef0d5134f in August 1999. WITH_THX() was used again
for DEBUG_CX() in 1c98cc53150c4860, and eliminated in d9f81b50694a810f.
WITH_THR() was added in 1997 in 0f15f207c55ce70f. Use everywhere except
DEBUG_SCOPE() was eliminated in 2006 in 11206fddaf7ef068. WITH_THR() was
removed from DEBUG_SCOPE() in d9f81b50694a810f.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Without this, the VMS compiler, with warnings cranked up to level 4,
emits pages and pages of things like:
dVAR;
....^
%CC-I-NOPARMLIST, The declaration of the function Perl___notused has
an empty parameter list. If the function has parameters, they should
be declared here; if it has no parameters, "void" should be specified
in the parameter list.
at line number 100 in file MDA0:[SMOKE.blead]perl.c;1
Over 2,000 of these plus other warnings yields a smoke report of 750K,
which is quite a bit over the 400K limit of the perl.org mailing lists,
not to mention being a slow read.
|
|
|
|
|
|
| |
Without this, the main Makefile and Makefile.micro interfere with each other,
as they both generate the same 5 files, and both think that they can delete
them with their respective clean targets.
|
|
|
|
|
|
|
| |
For the default (non-multiplicity) configuration, PERLVAR*() macros now
directly expand their arguments to tokens such as C<PL_defgv>, instead of
expanding to C<PL_Idefgv>. This removes over 350 lines from F<embedvar.h>,
which defined macros to map from C<PL_Idefgv> to C<PL_defgv> and so forth.
|
| |
|
|
|
|
|
|
| |
This was inadvertently added as part of eba804b9d4475c6d, but only causes
t/porting/bincompat.t to fail on those platforms that define
HAVE_INTERP_INTERN. It's always the really subtle things that catch you out.
|
|
|
|
|
| |
It had most, but not all, C pre-processor options that change the size of the
interpreter struct.
|
|
|
|
|
| |
Under a DEBUGGING build, this reduces the size of the perl binary by about
10%, and reduces the time to run the test suite by about 10-20%% (!)
|
| |
|
|
|
|
| |
This is the first step in adding a dtrace probe for global phase change
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously dNOOP would declare an unused variable, and where possible mark it
as "unused" to prevent compiler warnings. However, clang doesn't provide
attribute unused, so will produced screenfuls of warnings if invoked with
-Wunused-variable, hiding the real unused variable warnings.
Using a function declaration instead avoids these warnings.
We can't just use define dNOOP as nothing, or a comment, as it is used as
dNOOP;
and a bare semicolon is an error.
|
|
|
|
|
|
|
| |
Unicode inversion lists commonly will contain UV_MAX, which may
trigger these warnings. Add a flag to suppress them to the numeric
grok functions, which can be set by the code that is dealing with
these lists
|
|
|
|
|
| |
They exist solely to ensure that Perl_runops_standard and Perl_runops_debug
are linked in - nothing assigns to either variable, and nothing reads them.
|
|
|
|
| |
Make them const U16 - they should have been const from the start.
|
|
|
|
|
| |
To get the initialisation to work, the location of #include patchlevel.h needs
to be moved.
|
|
|
|
|
|
|
|
| |
On OS/2, keep it in perlvars.h, as it's not const there. makedef.pl doesn't
pay attention to C pre-processor symbols, so it will always see the declaration
in perlvars.h, and add the symbol to the linker file, so no need to mention
sh_path in globvar.sym. Add special case logic in regen/embed.pl to make the
embedvar.h macros for PL_sh_path defined only on OS/2.
|
|
|
|
|
|
|
|
|
|
|
| |
They were converted in perl.h from const char[] to #define in 31fb120917c4f65d,
then re-instated as const char[], but in perlvars.h, in 3fe35a814d0a98f4.
There's no need for compile-time constants to jump through the hoops of
perlvars.h, even for Symbian, as the various "EXTCONST" variables already in
perl.h demonstrate.
These were the only 3 users of the the PERLVARISC macro, so eliminate that, and
all related code.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Under MULTIPLICITY, intrpvar.h is included "early", as:
struct interpreter {
# include "intrpvar.h"
};
with local definitions of PERLVAR{,A,I,IS,ISC} that generate output text for the
"variables" as structure members. Additionally, under PERL_GLOBAL_STRUCT
"perlvars.h" is included within struct perl_vars { ... }.
Move the definition/undefining of these 5 macros to within the
#ifdef MULTIPLICITY block, to clarify the limited intent of their scope.
Move some additional related PERL_GLOBAL_STRUCT setup to within the block.
|
|
|
|
|
| |
Two members, flags and fallback, were using integer types considerably larger
than the range of values that they needed to store.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use this to simplify the logic in Perl_sv_magic().
This introduces a small change of behaviour for error cases involving unknown
magic types. Previously, if Perl_sv_magic() was passed a magic type unknown to
it, it would
1: Croak "Modification of a read-only value attempted" if read only
2: Return without error if the SV happened to already have this magic
3: otherwise croak "Don't know how to handle magic of type \\%o"
Now it will always croak "Don't know how to handle magic of type \\%o", even
on read only values, or SVs which already have the unknown magic type.
|
|
|
|
| |
Use this to replace S_is_container_magic() in mg.c with a direct lookup.
|
|
|
|
|
|
|
|
|
|
|
| |
Use it to eliminate the large switch statement in Perl_sv_magic().
As the table needs to be keyed on magic type, which is expressed as C character
constants, the order depends on the compiler's character set. Frustratingly,
EBCDIC variants don't agree on the code points for '~' and ']', which we use
here. Instead of having (at least) 4 tables, get the local runtime to sort the
table for us. Hence the regen script writes out the (unsorted) mg_raw.h, which
generate_uudmap sorts to generate mg_data.h
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Nothing visible on CPAN uses either. Passing either to Perl_get_vtbl() will
currently return NULL (as a runtime error, rather than a compile time error).
The case for want_vtbl_glob was removed from the switch in Perl_get_vtbl() in
c0c446747ad6c5bd (which eliminated the need for magic on typeglobs).
want_vtbl_symtab was added to the enum in perl.h with 8d2f45362e368d7d, but
no code was added to Perl_get_vtbl() as there is no corresponding vtable.
|
|
|
|
|
|
| |
Generating mg_vtable.h with MGVTBL_SET() effectively pre-expanded makes things
clearer. This eliminates use of the macro MGVTBL_SET(), which can be deleted
as nothing outside the core is relying on it.
|
|
|
|
|
|
| |
Putting the cast inside the initialiser (the only initialiser using it)
eliminates use of the macro MGVTBL_SET_CONST_MAGIC_GET(), which can be deleted
as nothing outside the core is relying on it.
|
|
|
|
|
|
|
|
|
|
|
| |
Previously perl.h contained a long section of MGVTBL_SET() macros declaring
the core's various magic vtables. Convert the information into data structures
in a new script regen/mg_table.pl, and use this to generate a new file
mg_vtable.h, included by perl.h
This is the first step in reducing the number of places that data relating to
magic vtables is declared (and has to be kept in sync), and will allow more
flexibility in parts of the core's implementation.
|
|
|
|
|
| |
Magic with a NULL vtable is equivalent to magic with a vtable of all 0s.
On CPAN, only Apache::Peek's code for 5.005 is referencing it.
|
|
|
|
| |
This turns out to be a simpler solution than 9ba75e3cf905a6e6.
|
|
|
|
|
|
|
|
|
|
| |
The socket libraries provided by the C run-time have been the
only viable option for building sockets in Perl for many years,
so we don't need to take up a valuable slot in the options list
to record that we're using them.
Also, the new bincompat.t test requires options to be in alpha-
betical order, and this wasn't.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a re-implementation of the tainting code in pp_subst and
pp_substcont. Although this fixes many bugs, because its a de-novo rewrite
of the tainting parts of the code in those two functions, it's quite
possible that it breaks some existing tainting behaviour. It doesn't break
any existing tests, although it turns out that this area was severely
under-tested anyway.
The main bugs that this commit fixes are as follows, where:
T = a tainted value
L = pattern tainted by locale (e.g. use locale; s/\w//)
Happens both with and without 'use re taint' unless specified.
Happens with all modifiers (/g, /r etc) unless explicitly mentioned.
$1 unexpectedly untainted:
s/T//
T =~ s/// under use re 'taint'
original string unexpectedly untainted:
s/L//, s/L//g
return value unexpectedly untainted:
T =~ s///g under no re 'taint'
s/L//g, s/L//r
return value unexpectedly tainted:
s/T//
s//T/r under no re 'taint'
T =~ s/// under use re 'taint'
s//T/ under use re 'taint'
Also, with /ge, the original string becomes tainted as soon as possible
(usually in the second entry to the /e code block) rather than only at the
end, in code like
$orig =~ s/T/...code.../ge
The rationale behind the taintedness of the return value of s/// (in the
non /r case), is that a boolean value shouldn't be tainted. This
corresponds to the general perl tainting policy that boolean ops don't
return tainted values. On the other hand, when it returns an integer
(number of matches), that should be tainted.
A couple of note about the old tainting code this replaces: firstly, several
occurrences of the following were NOOPs, since rxtainted was U8 and the bit
being ored was > 256:
rxtainted |= RX_MATCH_TAINTED(rx)
secondly, removing a whole bunch of the following didn't make any
existing tests fail:
TAINT_IF(rxtainted & 1);
|
|
|
|
|
| |
This was a temporary type used while regexes were in the process
of being promoted to first-class SVs
|
|
|
|
|
|
|
|
| |
As it and Perl_yylex() both need FEATURE_IS_ENABLED, feature_is_enabled() is
no longer static, and the two macro definitions move from toke.c to perl.h
Previously, one had to cut and paste the output of perl_keywords.pl into the
middle of toke.c, and it was not clear that it was generated code.
|
| |
|
|
|
|
|
|
|
|
|
| |
# New Ticket Created by (Peter J. Acklam)
# Please include the string: [perl #81904]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=81904 >
Signed-off-by: Abigail <abigail@abigail.be>
|
|
|
|
|
|
| |
instead of the less familiar octal for larger values. Perhaps they
should actually print the actual character, but this is far easier than
the previous to understand.
|
|
|
|
|
|
|
| |
This patch adds an option to pv_escape() to dump all characters above ASCII
in hex. Before, you could get all chars as hex or the Latin1 non-ASCII
as octal, whereas the typical values for these that people think in are
given in hex.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes the following compilation errors:
regexec.c: In function 'char* S_find_byclass(regexp*, const regnode*, char*,
const char*, regmatch_info*)':
regexec.c:1525: error: invalid conversion from 'I32 (*)(const char*, const
char*, I32)' to 'I32 (*)()'
regexec.c:1525: error: too many arguments to function
regexec.c:1527: error: invalid conversion from 'I32 (*)(const char*, const
char*, I32)' to 'I32 (*)()'
regexec.c:1527: error: too many arguments to function
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently if an operation on a file handle is interrupted, and if
the signal handler accesses that same file handle (e.g. closes it),
then perl will crash. See [perl #75556].
This commit provides some basic infrastructure to avoid segfaults.
Basically it adds a lock count field to each handle (by re-purposing the
unused flags field in the PL_perlio array), then each time a signal
handler is called, the count is incremented. Then various parts of PerlIO
use a positive count to change behaviour. Most importantly, when layers
are popped, the PerlIOl structure is cleared, but not freed, and is left
in the chain of layers. This means that callers still holding pointers to
the various layers won't access freed structures. It does however mean
that PerlIOl structs may be leaked, and possibly slots in PL_perlio. But
this is better than crashing.
Not much has been done to give sensible behaviour on re-entrancy; for
example, a buffer that has already been written once might get written
again. Fixing this sort of thing would require a large-scale audit of
perlio.c.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This allows any layer to find the top of the layer stack,
or more specifically, the entry in PL_perlio that points to
the top.
Needed for the next commit, which will implement a reference counting
scheme.
There's currently a bug in MakeMaker which causes several extensions to
miss the dependency on perliol.h having changed, so this commit includes
a gratuitous whitespace change to perl.h to hopefully force recompilation.
|
|
|
|
|
|
| |
The adds a folding table that works on the full Latin1 character set,
except for three problematic characters that need special handling.
It is accessed by PL_fold_latin1.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The PL_fold table map on EBCDIC only works on the ASCII-subrange
characters, not the full native Latin1.
To fix this, I moved the table to utfebcdic.h for EBCDIC platforms, and
actually changed it to three tables, one for each of the code pages
known to Perl.
There is no EBCDIC platform available to test on. What I did was hack
together a program from existing code that does EBCDIC transforms. I
ran it in ASCII mode, and verified that the generated table was
identical to the Latin1 table I had previously constructed by hand and
extensively tested. I then ran it on each of the three EBCDIC
transforms, and verified that each matched the places in the original
table that I knew were correct, all the ASCII alphabetics, the controls,
and a few other code points.
So these tables are at least as correct as the existing one, as they are
identical to it for [A-Z], [a-z].
|