| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
6f1401dc2acd2a2b85df22b0a74e5f7e6e0a33aa was over-enthusiastic
on removing redundant code in the comparison ops. This code was only used
on 64-bit #ifdef branches which is why I failed to spot it earlier.
So restore that code!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In most places, ops checked their args for overload *before* doing
mg_get(). This meant that, among other issues, tied vars that
returned overloaded objects wouldn't trigger calling the
overloaded method. (Actually, for tied and arrays and hashes, it
still often would since mg_get gets called beforehand in rvalue
context).
This patch does the following:
Makes sure get magic is called first.
Moves most of the overload code formerly included by macros at the
start of each pp function into the separate helper functions
Perl_try_amagic_bin, Perl_try_amagic_un, S_try_amagic_ftest,
with 3 new wrapper macros:
tryAMAGICbin_MG, tryAMAGICun_MG, tryAMAGICftest_MG.
This made the code 3800 bytes smaller.
Makes sure that FETCH is not called multiple times. Much of this
bit was helped by some earlier work from Father Chrysostomos.
Added new functions and macros sv_inc_nomg(), sv_dec_nomg(),
dPOPnv_nomg, dPOPXiirl_ul_nomg, dPOPTOPnnrl_nomg, dPOPTOPiirl_ul_nomg
dPOPTOPiirl_nomg, SvIV_please_nomg, SvNV_nomg (again, some of
these were based on Father Chrysostomos's work).
Fixed the list version of the repeat operator (x): it now only
calls overloaded methods for the scalar version:
(1,2,$overloaded) x 10
no longer erroneously calls
x_method($overloaded,10))
The only thing I haven't checked/fixed yet is overloading the
iterator operator, <>.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
bool b = (bool)some_int
doesn't necessarily do what you think. In some builds, bool is defined as
char, and that cast's behaviour is thus undefined. So this line in mg.c:
const bool was_temp = (bool)SvTEMP(sv);
was actually setting was_temp to false even when the SVs_TEMP flag was set.
Fix this by replacing all the (bool) casts with a new cBOOL() cast macro
that (hopefully) does the right thing.
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Under some circumstances the value returned by sprintf wasn't tainted,
even though its args were. While trying to fix this, I also came across
a second bug (which made fixing the first bug very confusing!) where
the TARG of the sprintf op, after getting tainted once, permanently
retained taint magic, which depending on circumstances, wasn't always set
to untainted (mg_len =0)
The original bug basically boiled down to parts of Perl_sv_vcatpvfn()
directly manipulating the target with SvGROW() / Copy(), which failed
to taint the target. Other parts used sv_catsv(), which did. So for
example:
"%s%s" failed, (only SvGROW)
"%s %s" worked (the space char was appended using sv_catsv).
|
| | |
|
| |
| |
| |
| |
| |
| | |
This change is a complement to 572558b47236782e60e41bd235c96eae7cbca3db.
Arithmetic on null pointers isn't defined by the C standard, so it may crash even before entering the loop.
|
|/ |
|
| |
|
|
|
|
|
|
|
| |
Change from a value/return offset pointer to passing a Unicode offset, and
returning a byte offset. The optional length value/return pointer remains.
Add a flags argument, passed to SvPV_flags(). This allows the caller to
specify whether mg_get() should be called on sv.
|
|
|
|
| |
(Tweaking 777f7c561610dee6.)
|
|
|
|
| |
available for the pos and len arguments, with safe conversion to STRLEN where it's smaller than an IV.
|
|
|
|
|
|
|
|
| |
This reverts commit b6d1426f94a845fb8fece8b6ad0b7d9f35f2d62e.
Conflicts:
pp.c
|
|
|
|
|
|
|
|
|
|
|
| |
Following v5.11.3-103-gb6d1426, any compiler paying attention
whines about the pointer mismatch (which on VMS breaks the
build).
Zefram reports a further patch in progress:
Message-ID: <20100116022631.GA10264@fysh.org>
but this gets the warning out of the way so other work can proceed.
|
|
|
|
| |
(This is only a partial fix, since it doesn't handle lvalue substr)
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
As the core no longer needs this fixed string outside of pp.c, it seems daft to
make it public just in case any module wants to use it. Modules that do should
provide their own inline copy in future.
Also restore the visible global PL_no_symref_sv back to the original format
specificiation (of 5.10.0 and earlier).
|
| |
|
|
|
|
|
| |
pp.c: In function `Perl_pp_delete':
pp.c:4297: warning: 'sv' might be used uninitialized in this function
|
|
|
|
| |
ENTER/LEAVE when debugging is enabled
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
The patch to speed up split in scalar context broke Font::GlyphNames,
because it stops scalar(@array = split) from working. The attached
patch fixes this, and ineluctably slows it down slightly.
(Patch amended by replacing the 2nd GIMME_V macro call by the gimme
variable)
|
| |
|
|
|
|
|
|
| |
Wasted a few minutes more than necessary trying to work out why the
string was truncated when in fact it was the error message that was
truncating the string.
|
|
|
|
|
|
|
| |
Since those keywords can now compile to two different ops each,
the usual inspection of opflags is not sufficient for perl to
return a meaningful prototype. So we hardcode the correct return
value for 5.12 : \[@%]
|
|
|
|
|
|
|
|
|
|
|
| |
Thread was "[PATCH] Make if (%hash) {} act the same as if (keys %hash) {}"
http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-11/msg00432.html
but the implementation evolved from the approach described in the subject, to
instead add a new opcode pp_boolkeys, to exactly preserve the existing
behaviour.
Various conflicts with the passage of time resolved, 'register' removed, and a
$VERSION bump.
|
|
|
|
|
|
|
| |
Replace ckWARN{,2,3,4}() && Perl_warner() with it, which trades reduced code
size (about 0.2%), for 1 more function call if warnings are not enabled.
However, if we're now in the L1 or L2 cache when we weren't previously, that's
still going to be a speed win.
|
|
|
|
|
| |
That is, only push the len when the static context is not void, and honour
len magic.
|
|
|
|
|
|
|
|
|
|
| |
The attached patch avoids pushing an IV onto the stack for a push op
in void context. The "Is there attached magic" branch in the op checks
for void context as does the non-magical branch in the unshift op.
-- c
[Edited version of patch after review by Yitzchak Scott-Thoennes]
|
|
|
|
| |
Improve the performance of split in scalar context
|
|
|
|
| |
Remove the long deprecated feature where split in scalar context writes to @_
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Remove the check for code refs in pp_lock.
For debugging, assert that the ref is not a code ref
(per Dave Mitchell's suggestion).
|
|
|
|
| |
so that the array recovers its previous length. Honour EXISTS and DELETE for tied arrays.
|
|
|
|
| |
pp_hslice
|
|
|
|
|
|
|
|
| |
context to method and can result in needless calls to FETCHSIZE
From: "Luke Ross" <lukeross@gmail.com>
Message-ID: <970a62710809301441v1d8d1877tfc30d7b91cd4dc1a@mail.gmail.com>
p4raw-id: //depot/perl@34908
|
|
|
|
|
|
|
| |
strings are detainted
Message-ID: <20081117071429.GD5495@tytlal.topaz.cx>
p4raw-id: //depot/perl@34860
|
|
|
|
|
|
|
|
|
|
|
|
| |
handler to SIG_DFL
Message-ID: <20081112234504.GI2062@tytlal.topaz.cx>
Updated patch to retain source compatibility.
Plus using the correct PERL_ARGS_ASSERT_SAVE_HELEM_FLAGS
macro and running make regen.
p4raw-id: //depot/perl@34829
|
|
|
|
|
| |
Message-ID: <20081111000040.GB19329@tytlal.topaz.cx>
p4raw-id: //depot/perl@34819
|
|
|
|
|
|
| |
Message-ID: <25940.1225611819@chthon>
Date: Sun, 02 Nov 2008 01:43:39 -0600
p4raw-id: //depot/perl@34698
|
|
|
|
|
|
| |
This is mostly to silence gcc's warning, "format not a string
literal and no format arguments".
p4raw-id: //depot/perl@34694
|
|
|
|
|
|
| |
Can't easily do gv.h, as GvGP() (at least) needs to split into two
macros - one const for reading, one non-const for writing.
p4raw-id: //depot/perl@34679
|