| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Did you know that a subroutine’s prototype can be modified with s///?
Don’t look:
*AUTOLOAD = *Internals'SvREFCNT;
my $f = "Just another "; eval{main->$f};
print prototype AUTOLOAD;
$f =~ s/Just another /Perl hacker,\n/;
print prototype AUTOLOAD;
You did look, didn’t you? You must admit that’s creepy.
The problem goes back to this:
commit adb5a9ae91a0bed93d396bb0abda99831f9e2e6f
Author: Doug MacEachern <dougm@covalent.net>
Date: Sat Jan 6 01:30:05 2001 -0800
[patch] xsub AUTOLOAD fix/optimization
Message-ID: <Pine.LNX.4.10.10101060924280.24460-100000@mojo.covalent.net>
Allow AUTOLOAD to be an xsub and allow such xsubs
to avoid use of $AUTOLOAD.
p4raw-id: //depot/perl@8362
which includes this:
+ if (CvXSUB(cv)) {
+ /* rather than lookup/init $AUTOLOAD here
+ * only to have the XSUB do another lookup for $AUTOLOAD
+ * and split that value on the last '::',
+ * pass along the same data via some unused fields in the CV
+ */
+ CvSTASH(cv) = stash;
+ SvPVX(cv) = (char *)name; /* cast to loose constness warning */
+ SvCUR(cv) = len;
+ return gv;
+ }
That ‘unused’ field is not unused. It’s where the prototype is
stored. So, not only is it clobbering the prototype, it’s also leak-
ing it by assigning over the top of SvPVX. Furthermore, it’s blindly
assigning someone else’s string, which could be freed before it’s
even used.
Since it has been documented for a long time that SvPVX contains the
name of the AUTOLOADed sub, and since the use of SvPVX for prototypes
is documented nowhere, we have to preserve the former.
So this commit makes the prototype and the sub name share the same
buffer, in a manner resembling that which CvFILE used before I changed
it with bad4ae38.
There are two new internal macros, CvPROTO and CvPROTOLEN for retriev-
ing the prototype.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the pad API was added, the special
m|pad_check_dup|SV *name|U32 flags|const HV *ourstash
sequence was added to pad.c, but that is unnecessary as it is listed
in embed.fnc. Also it is not correct, as the name of the function is
in the return value field.
So this restore it back to the simple ‘=for apidoc pad_check_dup’.
The description of the function was in plain text like this:
Check for duplicate declarations: report any of:
* a my in the current scope with the same name;
* an our (anywhere in the pad) with the same name and the same stash
as C<ourstash>
C<is_our> indicates that the name to check is an 'our' declaration
which gets rewrapped in rendered pod. So this patch changes it to use
a verbatim block (as autodoc.pl doesn’t seem to like pod lists).
|
|
|
|
|
| |
This mentions the UTF8 flag and moves the discussion to perlapi, where
it belongs, IMHO.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
[DELTA]
0.80 Sun Oct 9 21:00:21 2011
- U::C::Locale newly supports locales: bs, hi, kn, kok, ln.
- added loc_bs.t, loc_hi.t, loc_kn.t, loc_kok.t, loc_ln.t in t.
- updated some locales to CLDR 2.0 : ha, hr, kk, lt.
0.79 Sun Oct 2 20:31:01 2011
- pod: [rt.cpan.org #70241] Fix minor grammar error in manpage
by Harlan Lieberman-Berg.
- 'suppress' no longer affects contractions via 'entry'.
- U::C::Locale newly supports locales: as, fi__phonebook, gu.
- added loc_as.t, loc_fiph.t, loc_gu in t.
- updated some locales to CLDR 2.0 : ar, be, bg.
|
|
|
|
| |
Without this, Configure can't find libm.so on mutli-arch Linux systems.
|
|
|
|
|
|
| |
Other parts of the documentation already refer to it as a
‘null byte’ or ‘null’, which looks much nicer, as it is a
real English word.
|
|
|
|
|
| |
SvEND does not point to the last character, but to a spot
just after it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(Both functions actually end with _flags, but I’m trying to keep the
first line short.)
Now that sv_catpvn_flags has this functionality (as of c682ebef86),
sv_catsv can use it, which avoids creating an extra SV for the
utf8+bytes case and removes some duplicate logic.
Also, one code path in sv_utf8_upgrade_flags_grow was ignore the
_grow, causing crashes after the sv_catsv change, so this patch fixes
that, too.
Also, sv_catpvn_flags was not allocating a byte for the trailing
nul, which was entirely my fault (c682ebef86). So that is hereby
fixed as well.
|
| |
|
|
|
|
|
|
|
|
| |
If the stash in question has no name, the attempt to generate the
warning will cause a crash.
Simply skipping the warning is this case is fine, as this is will into
‘undefined’ territory (but it still shouldn’t crash).
|
|
|
|
| |
This documentes commit 0bda3001dd6310abfca950134ed78f6192d3d8a7
|
|
|
|
|
| |
Use F<> consistently when describing files. Remove --target=perl from an
example in the synopsis.
|
|
|
|
|
|
| |
_is_utf8__perl_idstart is not an API function, so the short
_is_utf8__perl_idstart form cannot be used in public macros.
The long form (Perl__is_utf8__perl_idstart) must be used.
|
|
|
|
|
|
|
|
|
|
|
| |
Automatically disable the build of DB_File for commits earlier than
ccb44e3bf3be2c30, as it's not practical to patch DB_File 1.70 and earlier
to build with current Berkeley DB headers.
This can be overridden with -Unoextensions
This should now permit building to 'test_prep' on systems with Berkeley DB
installed, for 5.005_62 and earlier.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Without this, Configure may fail prior to commit 1cfa4ec74d4933da (which
added the 'ignore_versioned_solibs' logic), because bisect-runner.pl's code
to set libs relies on successfully finding at least one library to pass to
./Configure with -Dlibs=
miniperl and perl should now build back to perl-5.000 on 32 bit Linux.
test_prep may not work, as early versions of DB_File.xs will fail if a
new db.h is found.
|
|
|
|
|
|
|
|
| |
Without this it won't build if db.h is found, but it's "too new" for the
checked-out vintage XS code.
Tweak apply_patch() to print out any patch that fails to apply. This helps
with debugging patches generated dynamically by bisect-runner.pl
|
|
|
|
|
|
| |
The Makefile.PL for Unicode::Normalize needs lib/unicore/CombiningClass.pl.
Even without a parallel build, we need a dependency to ensure that it builds
first. This problem was solved in blead with commit 9f3ef600c170f61e.
|
|
|
|
|
|
| |
SVpad_STATE is only used on SVs which hold PAD names; make it share the
same flags bit as SVprv_WEAKREF/SVf_IVisUV. Together with the previous
commit, this frees up a single bit in SvFLAGS, 0x00010000.
|
|
|
|
|
|
|
|
|
|
|
| |
SVs_PADSTALE is only meaningful with SVs_PADMY, while
SVs_PADTMP is only meaningful with !SVs_PADMY,
so let them share the same flag bit.
Note that this doesn't yet free a bit in SvFLAGS, as the two
bits are also used for SVpad_STATE, SVpad_TYPED.
(This is is follow-on to 62bb6514085e5eddc42b4fdaf3713ccdb7f1da85.)
|
|
|
|
| |
This avoids creating a lot of temporary SVs.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For some historical revisions, it's not good enough simply taking out the
first #include <asm/page.h>, because other code changes in that area can
break the build. Instead, replace any old version of that #ifdef forest with
the current code. Additionally, do this editing unconditionally, even if the
target is "miniperl". Skipping it on target "miniperl" causes surprises if
one is trying to debug the build by getting bisect-runner.pl to build to
miniperl (or skip), and then using make lib/auto/IPC/SysV/SysV.so
as the test case.
This adds an edit_file() function. Move apply_patch() next to it, to group
related functions together.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Note: while I discovered the incorrect types while investigating [perl
described in that report, so I don't consider this a fix for that bug.
Unfortunately to test this change I'd need a scalar at least 2G in
size, which unreasonable for a test we run on each install.
Tested manually on a machine with plenty of memory:
Before:
[tonyc@dromedary perl]$ echo foo | ./perl -le '$x = ""; read(STDIN, $x, 4, 5000000000); print length $x'
705032708
After:
[tonyc@dromedary perl]$ echo foo | ./perl -le '$x = ""; read(STDIN, $x, 4, 5000000000); print length $x'
5000000004
|
|
|
|
| |
This interface is unfortunate, but it's there and in use.
|
| |
|
|
|
|
|
|
| |
Suprisingly, gcc figured out that these were never used uninitialised
when I had the body of this function as part of gv_fetchpvn_flags, but
now it has trouble recognising that fact.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
I think I omitted the blessing by mistake. Taken alone, this
block does not crash in earlier versions without the bless.
|
|
|
|
| |
in view of 2e3468793982.
|
|
|
|
|
|
| |
See
http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2011-10/msg00079.html
for additional background.
|
| |
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This branch makes symbols support UTF8 internally, which means that
Unicode is supported properly at the perl level. So ${"\xff"} will
give you the same scalar, regardless of the internal encoding of the
string. Also, many parts of the core are now nul-clean, too, as a
result of the UTF8 changes, which means that ‘$m = "a\0b"; foo->$m’
will try to call the method named "a\0b", instead of just "a".
Details follow.
• New API functions:
Many of these take a _flags parameter, which accept the
SVf_UTF8 flag.
• HvNAMELEN
• HvNAMEUTF8
• HvENAMELEN
• HvENAMEUTF8
• gv_init_pv(n)/sv
• gv_fetchmeth_pv(n)/sv
• gv_fetchmeth_pv(n)/sv_autoload
• gv_fetchmethod_pv(n)/sv_flags — may change
• gv_autoload_pv(n)/sv
• newGVgen_flags
• sv_derived_from_pv(n)/sv
• sv_does_pv(n)/sv
• whichsig_pv(n)/sv
• New internal functions:
• GvNAMEUTF8
• GvENAMELEN
• GvENAME_HEK
• CopSTASH_flags
• CopSTASH_flags_set
• PmopSTASH_flags
• PmopSTASH_flags_set
• sv_sethek
• Parts of Perl that handle Unicode symbol names correctly:
• Method names (including those passed to ‘use overload’)
• Typeglob names (including variable and filehandle names)
• Package names
• Constant subroutine names (not nul-clean yet)
• goto
• Symbolic dereferencing
• Second argument to bless() and tie()
• Return value of ref()
• Package names returned by caller()
• Subroutine prototypes
• Attributes
• Warnings and error messages that mention filehandles, packages,
methods, variables, constant values, subroutines, symbolic refer-
ences, format names and subroutine prototypes
• Parts of Perl that now handle embedded nuls correctly:
• Method names
• Typeglob names (including filehandle names)
• Package names
• Autoloading
• Return value of ref()
• Package names returned by caller()
• Filehandle warnings
• Typeglob elements (*foo{"THING\0stuff"})
• Signal names
• Warnings and error messages that mention (yes, it’s the same list
as above) filehandles, packages, methods, variables, constant val-
ues, subroutines, symbolic references, format names and subroutine
prototypes
• Other bug fixes
• *{é} now treats é as the name of the glob (the usual implicit
quoting), instead of treating it as a bareword (strict-unsafe)
or function call. *{é} used to be equivalent to *{+é}, in
other words.
• Modified modules:
• constant has been modified not to apply the workaround for the bug
that this branch fixes, if that workaround does not apply.
• attributes has been modified as part of making Unicode attri-
butes work.
• XS::APItest
• mro, as part of making method lookup account for Unicode.
• Side effects
• Blessing into "\0" no longer causes ref() to return false.
• *{"*é::..."} is now equivalent to *{"é::..."}, just as
*{"*e::..."} is equivalent to *{"e::..."}. Previously, the * was
only stripped if followed by [A-Za-z].
• $é is now subject to ‘Used only once’ warnings. It used to be
exempt, as the code that checked the named considered it a punctu-
ation variable.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
This adds _pv, _pvn, and _pv versions of whichsig() in mg.c, which
get both kill "NAME" and %SIG lookup nul-clean.
|
| | |
|