| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In dd66b1d793 we added an assert to perl_run() that PL_restartop should
never be true when perl_run() is called after perl_parse(). Looked at
from the point of the internals, which calls perl_parse() and perl_run()
exactly once, this made sense.
It turns out however that there is at least one XS module out there that
expects to be able to set PL_restartop and then call perl_run(). If that
works out for them then we shouldn't block it, as we aren't really
trying to say "perl_run() should never be called with PL_restartop set"
(at least this assert wasn't trying to say that really), we are trying
to assert "between the top level transition from perl_parse() to
perl_run() we shouldnt leak any PL_restartop".
One could argue the assert maybe should go at the end of perl_parse(),
but I chose to put it in Miniperl.pm and thus into perlmain.c and
miniperlmain.c as I am not certain that perl_parse() should never be
called with PL_restartop set already, and putting it in the main code
really does more closely reflect the intent of this assert anyway.
This was reported as Blead Breaks CPAN Github Issue #20557.
|
|
|
|
|
|
|
| |
Now environ isn't owned by Perl and calling setenv/putenv in XS code
will no longer result in memory corruption.
Fixes #19399
|
|
|
|
|
|
|
|
| |
This was originally added for MinGW, which no longer needs it, and
only still used by Symbian, which is now removed.
This also leaves perlapi.[ch] empty, but we keep the header for CPAN
backwards compatibility.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Under PERL_GLOBAL_STRUCT (well, actually I've only tried under
PERL_GLOBAL_STRUCT_PRIVATE), cpan/ExtUtils-MakeMaker/t/03-xsstatic.t
was failing some tests. This was because it was creating a
statically-linked perl binary, but wasn't compiling perlmain.c with
-DPERL_CORE. Usually this doesn't matter, but under PERL_GLOBAL_STRUCT
it needed a definition of aTHX which it was pulling from XSUB.h rather
than perl.h, causing a SEGV.
Until a proper fix makes it way into MakeMaker, explicitly define
PERL_CORE in perlmain.c
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some platform-specific embeddings of perl were misusing the
return values from perl_parse() and perl_run(), in some cases
causing failure due to exit(0) combined with the recent changes
in commit 0301e899536a22752f40481d8a1d141b7a7dda82. Commit
d4a50999a5525c2681d59cae5fcd94f94ff897fd partially fixed a Windows
embedding. More fully fix that, along with NetWare and OS/2. Even in
embeddings with correct logic, stop using a variable named "exitstatus"
to hold the result of perl_parse() or perl_run(), to avoid misleading
people who copy the code.
|
|
|
|
|
|
|
|
| |
ExtUtils::Miniperl is used to generate both miniperlmain.c and perlmain.c,
but in different ways (via regen and via make respectively).
Update the pod in Miniperl.pm to explain this more clearly, and
imporve the header comment it emits in miniperlmain.c and perlmain.c.
|
|
|
|
|
|
|
| |
In Tru64 the cc -ieee enables the IEEE math but disables traps.
We need to reenable the "invalid" trap because otherwise generation
of NaN values leaves the IEEE fp flags in bad state, leaving any further
fp ops behaving strangely (Inf + 1 resulting in zero, for example).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- after return/croak/die/exit, return/break are pointless
(break is not a terminator/separator, it's a goto)
- after goto, another goto (!) is pointless
- in some cases (usually function ends) introduce explicit NOT_REACHED
to make the noreturn nature clearer (do not do this everywhere, though,
since that would mean adding NOT_REACHED after every croak)
- for the added NOT_REACHED also add /* NOTREACHED */ since
NOT_REACHED is for gcc (and VC), while the comment is for linters
- declaring variables in switch blocks is just too fragile:
it kind of works for narrowing the scope (which is nice),
but breaks the moment there are initializations for the variables
(the initializations will be skipped since the flow will bypass
the start of the block); in some easy cases simply hoist the declarations
out of the block and move them earlier
Note 1: Since after this patch the core is not yet -Wunreachable-code
clean, not enabling that via cflags.SH, one needs to -Accflags=... it.
Note 2: At least with the older gcc 4.4.7 there are far too many
"unreachable code" warnings, which seem to go away with gcc 4.8,
maybe better flow control analysis. Therefore, the warning should
eventually be enabled only for modernish gccs (what about clang and
Intel cc?)
|
|
|
|
|
|
|
| |
This reverts commit 8c2b19724d117cecfa186d044abdbf766372c679.
I don't understand - smoke-me came back happy with three
separate reports... oh well, some other time.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- after croak/die/exit (or return), break (or return!) are pointless
(break is not a terminator/separator, it's a promise of a jump)
- after goto, another goto (!) is pointless
- in some cases (usually function ends) introduce explicit NOT_REACHED
to make the noreturn nature clearer (do not do this everywhere, though,
since that would mean adding NOT_REACHED after every croak)
- for the added NOT_REACHED also add /* NOTREACHED */ since
NOT_REACHED is for gcc (and VC), while the comment is for linters
- declaring variables in switch blocks is just too fragile:
it kind of works for narrowing the scope (which is nice),
but breaks the moment there are initializations for the variables
(they will be skipped!); in some easy cases simply hoist the declarations
out of the block and move them earlier
There are still a few places left.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With PERL_GLOBAL_STRUCT_PRIVATE, all "global" vars are in a malloc()d
structure pointed to by the static var my_plvarsp. At exit, this struct is
freed and my_plvarsp is set to NULL.
My previous commit c1181d2b skipped the free if PL_veto_cleanup is set
(as it would be if other threads are still running for example), but
still left my_plvarsp getting set to NULL. Thus other threads could still
deref a null pointer if they accessed a "global" var just as the main
thread was exiting.
This commit makes the veto skip the NULLing in addition to the freeing.
This commit is quite late into the code freeze, but it's a follow-up to the
earlier attempt to get smokes not to fail, and all the affected code is
within #ifdef PERL_GLOBAL_STRUCT_PRIVATE, so it shouldn't affect
mainstream builds at all. (Famous last words.)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With PERL_GLOBAL_STRUCT_PRIVATE "global" variables are in a structure in
malloc()ed memory, not in global static variables or a global static
structure. Hence no global variables are implicitly initialised to zero.
* PL_curinterp and PL_op_sequence need initialising to NULL
* The global structure is free()d before handlers registered with atexit()
run, so be defensive about this.
* Some C code checks SvOK(PL_sv_placeholder) so ensure that its SvFLAGS()
are 0.
* Zero PL_hash_seed
|
|
|
|
|
|
|
|
| |
There is now only one copy of Perl code to generate the C for an xsinit()
function.
This also eliminates ExtUtils::Miniperl::canon(), which was not exported, and
is no longer needed.
|
|
|
|
|
|
|
| |
As miniperlmain.c is now generated by ExtUtils::Miniperl (and not the other
way round), there's no reason to have an editor block in the generated file,
as it's not intended to be edited. Instead, add the "generated from" and
read-only headers to miniperlmain.c
|
|
|
|
|
|
|
|
|
| |
Give it a $VERSION.
Bring the joy of strict (and warnings) to it.
Inline the C code into writemain() instead of using $head, $tail and a regex
to split the $tail into $tail1, $tail2 and $tail3.
Tweak the NAME section so that ABSTRACT_FROM parses it.
Document the updated functionality of writemain().
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now ExtUtils::Miniperl has the master version of {mini,}perlmain.c and is
checked into the repository. miniperlmain.c is now generated by a script
in regen/ which uses ExtUtils::Miniperl.
Tweak ExtUtils::Miniperl::writemain() to take an optional first argument,
a reference to a file handle. This permits the regen script to use the
regen_lib.pl functions for file opening/closing/renaming and TAP generation.
For now check in ExtUtils::Miniperl minimally modified from the version
generated by the former minimod.pl. The next commit will tidy it up.
|
| |
|
|
|
|
|
| |
The subdirectory containing the port specific files was purged when 5.000
was released, but changes made to other files were not removed.
|
| |
|
|
|
|
|
| |
This updates the editor hints in our files for Emacs and vim to request
that tabs be inserted as spaces.
|
|
|
|
|
| |
It is only ever checked for truth/falsehood, and all assignments to it (in core
and on CPAN) are either 0 or 1.
|
| |
|
|
|
|
|
|
| |
This is only normally defined if OEMVS is defined; the commit that added it
(2f3efc97) claims z/OS support. I guess no-one has tried this for awhile as
dd374669 broke this in 2005.
|
|
|
|
| |
since 5.005
|
|
|
|
|
|
|
|
| |
If the signal handler runs after perl_destruct() has been called, it
will get an invalid (or NULL) my_perl when it asks for the
thread-specific interpreter struct. This patch resets the signal
handler for any signal previously handled by PL_csighandlerp to SIG_DFL
before calling perl_destruct().
|
|
|
|
|
|
| |
Message-ID: <25940.1225611819@chthon>
Date: Sun, 02 Nov 2008 01:43:39 -0600
p4raw-id: //depot/perl@34698
|
|
|
| |
p4raw-id: //depot/perl@32237
|
|
|
| |
p4raw-id: //depot/perl@29696
|
|
|
|
|
|
|
| |
McCamant's comment
Message-ID: <44B67921.6090901@iki.fi>
p4raw-id: //depot/perl@28567
|
|
|
|
|
| |
Message-ID: <20060226204721.00be2bff@r2d2>
p4raw-id: //depot/perl@27343
|
|
|
|
|
| |
Message-ID: <20060221062711.GA16160@petdance.com>
p4raw-id: //depot/perl@27300
|
|
|
|
|
|
| |
in read-only mode. Make vi modelines compatible with non-vim
vi versions.
p4raw-id: //depot/perl@24445
|
|
|
|
|
| |
(except the generated ones)
p4raw-id: //depot/perl@24440
|
|
|
|
|
| |
Message-ID: <B356D8F434D20B40A8CEDAEC305A1F2453D653@esebe105.NOE.Nokia.com>
p4raw-id: //depot/perl@24271
|
|
|
| |
p4raw-id: //depot/perl@24106
|
|
|
|
|
|
|
|
| |
Message-ID: <20050325231409.GB17660@petdance.com>
[with modification - the extra argument to incpush was supposed to
be being used]
p4raw-id: //depot/perl@24081
|
|
|
| |
p4raw-id: //depot/perl@23746
|
|
|
|
|
|
|
|
|
| |
Message-ID: <20041111145443.GA1854@immd4.informatik.uni-erlangen.de>
slightly reworked to make the PL_use_safe_putenv variable fit in
the current framework. This patch turns on the use of safe putenv
for any application that embeds a perl interpreter.
p4raw-id: //depot/perl@23507
|
|
|
| |
p4raw-id: //depot/perl@23187
|
|
|
| |
p4raw-id: //depot/perl@23180
|
|
|
| |
p4raw-id: //depot/perl@23176
|
|
|
|
|
| |
as per suggestion from Sarathy.
p4raw-id: //depot/perl@19878
|
|
|
|
|
|
|
| |
is set very early in main(), before perl_parse()
has been called and PL_tainting (or PL_taint_warn)
might have been set.
p4raw-id: //depot/perl@19863
|
|
|
|
|
|
|
| |
(Lots of Perl 5 source code archaeology was involved.)
Larry didn't make strangled noises when I showed him
the patch, either :-)
p4raw-id: //depot/perl@19242
|
|
|
| |
p4raw-id: //depot/perl@18807
|
|
|
| |
p4raw-id: //depot/perl@18801
|
|
|
|
|
| |
Still imcomplete. Configure will follow
p4raw-id: //depot/perl@18030
|
|
|
|
|
|
| |
be found in the repository, which is most often not right,
but at least consistent)
p4raw-id: //depot/perl@14400
|
|
|
|
|
|
|
|
|
|
| |
in speed (upto 20% speedup in certain operations) but meanwhile
regexps and arithmetics got slower (5-10%) (according to
perlbench average speedup is negligible, and within measuring
flutter, 1%). Therefore retracting all the changes
aimed at getting -std1 to compile cleanly: #12475, #12476,
#12479, #12480, #12481, #12482, #12483, #12484.
p4raw-id: //depot/perl@12485
|