| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
OpenVMS v7.0 was released in 1995. There have been no reports of
recent releases of Perl building on versions that far back, yet we
still have quite a bit of code that explicitly supports versions
*prior* to v7.0.
There is a similar story for DEC C v6.0. It was released in 1998,
and has been superceded by numerous subsequent versions. Yet the
VMS-specific code in the core is littered with workarounds and
hacks that defend against deficiencies in very old compiler
versions.
This code is for all practical purposes no longer maintained or
maintainable, so the best path forward seems to be to remove it.
Anyone able and willing to commit to long-term support of it
could argue for its restoration, assuming Perl 5.14.x is not
adequate.
|
|
|
|
|
|
|
|
|
|
| |
Previously the code for "--help" and "--version" set a local variable to a
string corresponding to the single character option ("h" or "v"
respectively), then restarted the option parsing code, which would then call
into Perl_moreswitches(), which would then use a switch statement to
dispatch to the final code.
This is not as clear as it could be.
|
| |
|
|
|
|
|
| |
This simplifies the code, as it's only called from one spot, in
Perl_moreswitches().
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This particular C<STRLEN len;> came along almost 15 years ago, way
back in aa6893958c2b. Back then it was a plain and simple block
scope variable. But now this code lives in a function that takes
as an argument a variable of the same name and having the same
meaning (i.e., the length of the directory name to be added to
@INC). Someone looking only at the argument list might reasonably
expect to be able to use len (though luckily there are no subsequent
uses of it currently). So we really ought to update that len rather
than create our own when we hijack the directory name to make our
unixified version of it.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Back in 3185893b8dec106 I moved some code from the beginning of one
block to the middle of a different block. Bad me. The compiler
has been lax about allowing declarations in the middle of a block,
so we haven't noticed. But as of c29067d7797853039, the code moved
to a new function while leaving the block it was in behind and we
end up with conflicting declarations of len.
Making our own block seems like the safest thing to do. The
indentation in this section of code is a bit wacky -- I chose the
least intrusive alternative for clearer blame logs.
|
|
|
|
|
|
|
|
| |
Following commit 816005240f1a3b99, which moved VMS-specific code, we can now
assign to subdir at the point of declaration. After the refactoring that
moved code into S_mayberelocate(), we can assign to libdir at the point of
declaration. In turn, this allows the merging of two #ifndef PERL_IS_MINIPERL
blocks. Remove a blank line from S_mayberelocate().
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously the generated code used regular '' strings, which meant that a
crafted pathname containing ' characters could be used to inject code.
Until the previous commit, this was only a problem if building in or
Configuring to install to such a directory. Which, hopefully, would be
"obviously wrong" to anyone capable of building Perl from source.
However, fixing the bug that prevented sitecustomize being subject to
relocatable include now means that for a relocatable pearl, an end-user
controlled path can now reach the sitecusomize code.
|
|
|
|
|
|
|
|
|
|
| |
When -Dusesitecustomize is used with -Duserelocatableinc,
SITELIB_EXP/sitecustomize.pl is not found due to SITELIB_EXP having a
'.../..' relocation path.
This patch refactors the path relocation code from S_incpush() into
S_mayberelocate() so that it can be used in both S_incpush() and in
usesitecustomize's use of SITELIB_EXP.
|
|
|
|
|
| |
Both bodies were the same, aside from hardcoded 't' and 'T', which can be
replaced with a variable.
|
|
|
|
|
|
|
|
|
|
| |
This stops PL_curstash from pointing to a freed-and-reused scalar in
cases like ‘package Foo; BEGIN {*Foo:: = *Bar::}’.
In such cases, another BEGIN block, or any subroutine definition,
would cause a crash. Now it just happily proceeds. newATTRSUB and
newXS have been modified not to call mro_method_changed_in in such
cases, as it doesn’t make sense.
|
| |
|
|
|
|
|
|
|
|
|
| |
Unicode stability policy guarantees that no code points will ever be
added to the control characters beyond those already in it.
All such characters are in the Latin1 range, and so the Perl core
already knows which ones those are, and so there is no need to go out to
disk and create a swash for these.
|
|
|
|
|
| |
This information is trivially computed via the macro, no need to go out
to disk and store a swash for this.
|
|
|
|
|
|
|
|
|
| |
In Configure, check whether _NSGetExecutablePath() can be used to find the
absolute pathname of the executable. If so, set usensgetexecutablepath in
config.sh and USE_NSGETEXECUTABLEPATH in config.h. If this is set, then use
this approach in S_set_caret_X() to canonicalise $^X as an absolute
path. This approach works on OS X, and possible on other platforms that
use dyld.
|
|
|
|
|
|
|
|
|
|
| |
In Configure, check whether sysctl() and KERN_PROC_PATHNAME can be used
to find the absolute pathname of the executable. If so, set
usekernprocpathname in config.sh and USE_KERN_PROC_PATHNAME in config.h.
If this is set, then use this approach in S_set_caret_X() to canonicalise
$^X as an absolute path. This approach works on (at least) FreeBSD, and
doesn't rely on the /proc filesystem existing, or /proc/curproc/file being
present.
|
|
|
|
|
|
|
|
|
| |
097ee67dff1c60f2 didn't need to include <locale.h> in locale.c (then
util.c) because it had been included by perl.h since 5.002 beta 1
3f270f98f9305540 missed removing the include of <unistd.h> from perl.c
or perlio.c
de8ca8af19546d49 changed perl.h to also include <sys/wait.h>, but didn't
notice that it code therefore be removed from perl.c, pp_sys.c and util.c
|
|
|
|
| |
This avoids duplicating the fallback code to set caret_x to PL_origargv[0].
|
|
|
|
|
|
|
|
| |
Possibly this should have been done as part of commit 3aa90d208c3bbfc1,
which broke S_set_caret_X() out from S_init_postdump_symbols().
[S_procself_val() was not inlined into S_init_postdump_symbols() because
Nick Ing-Simmons thought it unwise to hold on to MAXPATHLEN bytes of stack
longer than necessary.]
|
|
|
|
|
|
|
| |
Commit c69033f2a6291605 was inconsistent, in that it changed two instances
of GvSV() to GvSVn(), but not the third. The expansion of GvSV() is simpler,
and is appropriate here. Hoist the call to GvSV() out of the conditional
code.
|
|
|
|
| |
HOMEGROWN_POSIX_SIGNALS is only relevant on VMS.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commit eff7e72c3 (Detect incomplete caller overrides in Carp) used
this little trick for detecting a @DB::args that an overridden
caller() failed to set:
+ @args = \$i; # A sentinal, which no-one else has the address of
But there is a bug in caller(). The first time caller tries to write
to @DB::args, it calls Perl_init_dbargs first. That function checks
whether @DB::args is AvREAL, in case someone has assigned to it, and
takes appropriate measures. But caller doesn’t bother calling
Perl_init_dbargs more than once. So manually-assigned items in
@DB::args would leak, starting with the *second* call to caller.
Commit eff7e72c3 triggered that bug, resulting in a regression in
Carp, in that it started leaking. eff7e72c3 was backported to 5.12.2
with commit 97705941a4, so in both 5.12 and 5.14 Carp is affected.
This bug (the caller bug, not Carp’s triggering thereof) also affects
any caller overrides that set @DB::args themselves, if there are
alternate calls to the overridden caller and CORE::caller.
This commit fixes that by changing the if (!PL_dbargs) condition
in pp_caller to if (!PL_dbargs || AvREAL(PL_dbargs)). I.e., if
@args is either uninitialised or AvREAL then call Perl_init_dbargs.
Perl_init_dbargs also has a bug in it, that this fixes: The array not
only needs AvREAL turned off, but also AvREIFY turned on, so that
assignments to it that occur after its initialisation turn AvREAL back
on again. (In fact, Larry Wall added a comment suggesting this back
in perl 5.000.)
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
UNLINK_ALL_VERSIONS only makes sense for VMS.
|
|
|
|
|
| |
This is a patch to enhance perlapi.pod by providing Perl equivalents and
clarifying documentation where appropriate.
|
|
|
|
|
| |
It had most, but not all, C pre-processor options that change the size of the
interpreter struct.
|
|
|
|
| |
This is the first step in adding a dtrace probe for global phase change
|
|
|
|
|
| |
This allows more than one C<study> to be active at the same time.
It eliminates PL_screamfirst, PL_lastscream, PL_maxscream.
|
|
|
|
|
| |
Effectively, PL_screamnext is now PL_screamfirst + 256. The actual interpreter
variable PL_screamnext is eliminated.
|
|
|
|
|
|
|
|
|
|
|
| |
instead of caching it
The intent is that by not caching $$, we eliminate one opportunity for bugs:
If one embeds Perl or uses XS and calls fork(3) from C, Perls notion of $$
may go out of sync with what getpid() returns. By always fetching the
value of $$ via getpid(), this bug opportunity is eliminated. The overhead
of always fetching $$ should be small and is likely only used for tempfile
creation, which should be dwarfed by file system accesses.
|
|
|
|
|
|
| |
These 4 compile-time options should be reported, as they have affect the
behaviour of the interpreter binary (albeit only in a small area). They don't
affect binary compatibility.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Provide a preprocessor macro PERL_RELOCATABLE_INCPUSH to tell
incpush_use_sep() to ignore the passed in len argument. This
enables relocatable Perl distributions that patch the various
paths at install time.
Core Perl neither provides actual relocation scripts/programs,
nor endorses this practise as being "supported"; this patch
only makes it possible to create such tools. It is therefore
undocumented outside the source level comments.
|
|
|
|
|
|
| |
It's actually the default, but as all the C code is conditionally (not)
compiled on the basis of that pre-processor macro, seems that it is the one
that needs to be reported.
|
|
|
|
|
| |
Restore -I processing on the #! line for miniperl. This gets t/run/switchI.t
and t/run/switchd-78586.t passing again under minitest.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A side-effect of change 3185893b8dec1062 was to force av in S_incpush() to be
NULL, whilst other flag variables were still set as if it were non-NULL, for
certain cases, only when compiled with -DPERL_IS_MINIPERL
The "obvious" fix is to also set all the flag variables to 0 under
-DPERL_IS_MINIPERL, to make everything consistent. However, this confuses (at
least) the local version of gcc, which issues warnings about passing a NULL
value (av, known always to be NULL) as a not-NULL parameter, despite the fact
that all the relevant calls are inside blocks which are actually dead code,
due to the if() conditions being const variables set to 0 under
-DPERL_IS_MINIPERL.
So to avoid future bug reports about compiler warnings, the least worst thing
to do seems to be to use #ifndef to use the pre-processor to eliminate the
dead code, and related variables.
|
|
|
|
|
|
|
|
|
| |
This allows, for example, -I[.lib] to have Unix format appendages
added, such as "/buildcustomize.pl", "/sitecustomize.pl", etc.
It was previously only being converted to Unix syntax to allow the addition
of subdirectories, but the number of things that want to glue pieces onto
lib/ have multiplied over the years.
|
|
|
|
|
|
|
|
|
|
| |
The new logic in S_parse_body that loads lib/buildcustomize.pl in
miniperl relies on lib being in $INC[0], which it won't be if we've
loaded version- and architecture-specific directories before lib.
Since miniperl isn't installed and can't do dynamic loading, it
doesn't really need those subdirectories, so skip loading them
for miniperl.
|
|
|
|
|
|
| |
For miniperl (only), always enable USE_SITECUSTOMIZE, but change it to load
a buildcustomize.pl file from $INC[0], if present. The default @INC for
miniperl is '.', so by default this does nothing.
|
| |
|
|
|
|
|
|
|
|
|
| |
# 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>
|
| |
|
|
|
|
|
| |
It now only exists as a compatibility macro for extensions that want to
introspect it.
|
|
|
|
| |
This exposes the current top-level interpreter phase to perl space.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As noted in the comments of the code, "a" =~ /[A]/i doesn't work currently
(except that regcomp.c knows about the ASCII characters and corrects for
it, but not always, for example in cases like "a" =~ /\p{Upper}/i. This
patch catches all those).
It works by computing a list of all characters that (singly) fold to
another one, and then checking each of those. The maximum length of
the list is 3 in the current Unicode standard.
I believe that a better long-term solution is to do this at compile
rather than execution time, by generating a closure of everything
matched. But this can't be done now because the data structure would
need to be extensively revamped to list all non-byte characters, and
user-defined \p{} matches are not known at compile-time.
And it doesn't handle the multi-char folds. There is a separate ticket
for those.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Expose cop hint hashes as a type COPHH, with a cophh_* API which is a
macro layer over the refcounted_he_* API. The documentation for cophh_*
describes purely API-visible behaviour, whereas the refcounted_he_*
documentation describes the functions mainly in terms of the
implementation. Revise the cop_hints_* API, using the flags parameter
consistently and reimplementing in terms of cophh_*. Use the cophh_*
and cop_hints_* functions consistently where appropriate.
[Modified by the committer to update two calls to
Perl_refcounted_he_fetch recently added to newPMOP.]
|
|
|
|
|
| |
lex_start() is added to the API, marked experimental, and documented.
It also gains a flags parameter for foreseeable future use.
|
|
|
|
|
|
|
|
| |
PL_doextract had two unrelated jobs, neither best served by an interpreter
global variable. The first was to track the -x command-line switch.
That is replaced with a local variable in S_parse_body(). The second
was to track whether the lexer is in the middle of a =pod section.
That is replaced with an element in PL_parser.
|
|
|
|
|
|
|
|
| |
The only uses of lex_start that had the new_filter parameter false,
to make the new lexer context share source filters with the previous
lexer context, were uses with rsfp null, which therefore never invoked
source filters. Inheriting source filters from a logically unrelated
file seems like a silly idea anyway.
|