46221 Commits

Author SHA1 Message Date
Ricardo Signes
14d04a3346 update the editor hints for spaces, not tabs
This updates the editor hints in our files for Emacs and vim to request
that tabs be inserted as spaces.
2012-05-29 21:53:17 -04:00
Ricardo Signes
34a2706e50 clarify that it must be a simple identifier in {}
suggestion from Aristotle Pagaltzis in
https://rt.perl.org/rt3/Ticket/Display.html?id=112914
2012-05-29 21:51:41 -04:00
Reini Urban
fb55feefe9 related to [perl #113060] assert CopSTASH(cx->blk_oldcop)
HvNAME_HEK((HV*)CopSTASH(cx->blk_oldcop)) does some implicit assumptions, which should
better be asserted. Also record CX pp_caller reads besides PUSH and POP.
2012-05-29 14:55:54 -07:00
Reini Urban
014243a274 [perl #113060] Save cop_stashlen threaded even with shared cop pv
Perl_sv_compile_2op_is_broken() does at line 3354 a LEAVE_with_name("eval"),
a SSPOPSTR via SAVEt_SHARED_PVREF for the localized cop_stashpv, but
not for the cop_stashlen.
The cop in question is PL_compiling, which was "AutoSplit" before with
len=9 and restores it back to "main" but keeps len 9. Thus leading to a
heap-overflow in gv_stashpvn.
2012-05-29 14:55:19 -07:00
Father Chrysostomos
1b08e05188 [perl #97478] Make ‘Can’t find opnumber’ UTF-8- and null-clean 2012-05-29 09:41:14 -07:00
Father Chrysostomos
edba6325a4 [Merge] More coresubs
Until now, only overridable keywords had subs in the CORE:: namespace.

This branch adds subs to the CORE:: namespace for those non-overrida-
ble keywords that can be implemented without custom parsers.
2012-05-29 09:38:41 -07:00
Father Chrysostomos
b4aa8adbb6 bproto.t: Test pos(1,$b)
I nearly broke this.
2012-05-29 09:36:28 -07:00
Father Chrysostomos
39c0dbe329 Update CORE.pod to reflect the new coresubs 2012-05-29 09:36:28 -07:00
Father Chrysostomos
88bb468b2b Make &CORE::undef(\*_) undefine it properly
Unless called as &CORE::undef (without parentheses) after @_ has been
set to \*_, it leaves @_ in the ARRAY slot.

This is an implementation detail leaking through.

pp_entersub temporarily aliases @_ to a new array, which is restored
to its previous value on sub exit.

Since &CORE::undef is a perl sub with an op tree containing
an undef op,

$ ./perl -Ilib -MO=Concise,CORE::undef -e '\&CORE::undef'
CORE::undef:
3  <1> leavesublv[1 ref] K/REFC,1 ->(end)
2     <1> undef sKP/1 ->3
1        <$> coreargs(IV 44) s ->2
-e syntax OK

the undef op runs while @_ is localised.

So we should un-localise @_ if we detect that case.

Doing this in pp_coreargs might be a bit of a hack, but it’s less
code than rewriting &CORE::undef as an XSUB, which would be the
other option.

Either way, we need a special case, since undef is the only named op
that touches the ARRAY slot of the glob passed to it.
2012-05-29 09:36:28 -07:00
Father Chrysostomos
c4ec50f125 &CORE::undef should be an lvalue sub 2012-05-29 09:36:27 -07:00
Father Chrysostomos
46bef06f0f Add &CORE::undef
In the error message, we can’t say ‘&CORE::undef operator’, so we
should be using the op name, rather than the op description.

Instead of using OP_NAME(PL_op->op_next), which would expand to

    PL_op->op_next->op_type == OP_CUSTOM
	? XopENTRY(Perl_custom_op_xop(aTHX_ PL_op->op_next), xop_name)
	: PL_op_name[PL_op->op_next->op_type]

we can simply use PL_op_name[opnum], which should be quicker.

pp_undef can already handle nulls on the stack.

There is one remaining problem.  If &CORE::undef(\*_) is called, *_
will be undefined while @_ is localised during the sub call, so it
won’t have the same effect as undef *_.  I don’t know whether this
should be considered a bug or not, but I could solve it by making
pp_undef an XSUB.
2012-05-29 09:36:27 -07:00
Father Chrysostomos
d80ed30335 Add &CORE::study 2012-05-29 09:36:27 -07:00
Father Chrysostomos
a99f2ca207 Add &CORE::split 2012-05-29 09:36:26 -07:00
Father Chrysostomos
d33bb3da8c Add &CORE::scalar 2012-05-29 09:36:26 -07:00
Father Chrysostomos
919ad5f783 Add &CORE::prototype 2012-05-29 09:36:26 -07:00
Father Chrysostomos
1efec5ed46 Add &CORE::pos 2012-05-29 09:36:26 -07:00
Father Chrysostomos
abe56f58d6 Make pos use ck_fun and OA_SCALARREF
See the previous commit.  The same applies here.

In short, this allows core_prototype and pp_coreargs to be simpler.
2012-05-29 09:36:25 -07:00
Father Chrysostomos
89c5c07ef3 Make undef use ck_fun and OA_SCALARREF
In regen/opcodes, we have some operators that use ck_fun and have R
for the argument.  And there are some that use ck_lfun and have S for
the argument.

These both amount to more or less the same thing.

ck_fun/R goes through the OA_SCALARREF case in ck_fun, which calls
op_lvalue(scalar()) on the child op.

ck_lfun/S goes through the OA_SCALAR case in ck_fun, which calls
scalar(), and then ck_lfun sees to it that op_lvalue is called.

The only real difference is that the OA_SCALAR case makes sure there
are not too many arguments.

Since both core_prototype and pp_coreargs need special cases to deal
with OA_SCALAR that is really ‘supposed’ to be OA_SCALARREF, it
becomes simpler to add &CORE::undef if undef uses R.  In that case,
we also have to put the argument-checking in the OA_SCALARREF, but we
make it conditional on the op being an undef op, for the sake of doing
one thing at a time.  (This is a bit of a mess; see ticket #96006.)
2012-05-29 09:36:25 -07:00
Father Chrysostomos
498a02d80c Add &CORE::glob
I added a special case for OP_GLOB to pp_coreargs, since glob does not
have the u flag in regen/opcodes; hence PL_opargs[opnum] & OA_DEFGV is
false, even though glob does imply $_.

Adding the flag to regen/opcodes is not so simple, as the code in
ck_fun that adds the DEFSV op does not account for list ops, but
leaves op_last unchanged.

Changing ck_fun to account requires adding more code than this special
case in pp_coreargs.

OPf_SPECIAL indicates that glob was called with the CORE:: prefix.
2012-05-29 09:36:25 -07:00
Father Chrysostomos
2a90c7c66a pp.c:pp_coreargs: use PL_op_desc instead of OP_DESC
Instead of using OP_DESC on op_next, since we already know the op
number, we can just go straight to PL_op_desc, which is what OP_DESC
itself uses after looking inside op_next to find out what the op
number is.

BTW, &CORE::scalar will need this, since a scalar op is never actu-
ally executed, making coreargs’ op_next pointer point to another op
than expected:

2  <1> leavesublv[1 ref] K/REFC,1 ->(end)
-     <1> scalar sKP/1 ->2
1        <$> coreargs(IV 2) s ->2
-e syntax OK

Otherwise we get ‘Not enough arguments for lvalue subroutine return’.
2012-05-29 09:36:25 -07:00
Father Chrysostomos
d51f8b19c6 Add &CORE::exists 2012-05-29 09:36:24 -07:00
Father Chrysostomos
eb31eb3544 Add &CORE::delete 2012-05-29 09:36:24 -07:00
Father Chrysostomos
d885f758c3 Add &CORE::defined 2012-05-29 09:36:24 -07:00
Father Chrysostomos
6c871ae8e2 coresubs.t: Explicitly skip all unsupported keywords
Instead of skipping positive keywords (those that cannot be over-
ridden) because of their positivity, list them explicitly in the
skip list.

This will allow them to be removed one by one.
2012-05-29 09:36:24 -07:00
Father Chrysostomos
94c7f5d8eb coreamp.t: Explicitly skip all unsupported keywords
Instead of skipping positive keywords (those that cannot be over-
ridden) because of their positivity, list them explicitly in the
skip list.

This will allow them to be removed one by one.
2012-05-29 09:36:23 -07:00
Father Chrysostomos
88b892d8c8 gv.c: List all keywords with no coresubs
S_maybe_add_coresub returns NULL for any keywords that are not
overridable.

Instead of identifying them by the positivity of their codes, list
them all explicitly.

This will allow coresubs to be added for them one by one.
2012-05-29 09:36:23 -07:00
Father Chrysostomos
85d8325498 Update perlfunc/prototype
to account for the new inconsequentiality of non-overridability.
2012-05-29 09:36:23 -07:00
Father Chrysostomos
4e338c2189 Add protos for positive keywords
‘Positive’ means having a + before it in regen/keywords.pl; i.e., key-
words that cannot be overridden.

Since all keywords are going to be added as subs to the CORE:: name-
space, with prototypes wherever they can apply, it makes sense to
return prototypes for all that can have them, which turns out to be
only a handful.
2012-05-29 09:36:23 -07:00
Craig A. Berry
7d08496d81 Cast exception handler in dl_vms.xs.
C++ needs an explicit type on the handler.
2012-05-28 16:10:57 -05:00
Father Chrysostomos
4adb780114 Add test for [perl #113400] 2012-05-28 09:12:23 -07:00
Father Chrysostomos
1e1dfbf110 perlfunc: two missing words
This odd sentence was introduced in 8f1da26d.
2012-05-28 09:12:23 -07:00
Tony Cook
4aa4c0a57d perldelta for 2b42d7ed8 2012-05-28 23:59:20 +10:00
Tony Cook
2b42d7ed85 [perl #112272] return EEXIST on link() to an existing file
Also attempts to translate some other errors.

Unfortunately Microsoft don't document error codes.
2012-05-28 19:45:55 +10:00
Tony Cook
23629bd37b [perl #112272] test link()'s error returns (TODO) 2012-05-28 19:45:52 +10:00
Yves Orton
e8b06a558c Revert "fix [perl #76546] regex engine slowdown bug"
This reverts commit dee29c6b5bec1d6e7fccc971e31113a5d7cee844.

    $ perl5.16.0 -e 'warn "t/bin/good.pl syntax OK\n" =~ /syntax OK\s+\z/si'
    1 at -e line 1.
    $ bleadperl -e 'warn "t/bin/good.pl syntax OK\n" =~ /syntax OK\s+\z/si'
    Warning: something's wrong at -e line 1.

Will fix properly later.
2012-05-28 11:00:42 +02:00
Steve Hay
48f3d0c620 Update checkAUTHORS.pl with missing author 2012-05-28 09:53:57 +01:00
N/K
a970290aa9 [perl #111798] ExtUtils-CBuilder looks for the manifest file in the wrong place
Near the start of link(), $output gets set to a blib\arch\auto path.
A little later that gets copied into $spec{output}, but $spec{manifest}
is left unset so it gets set later to a $spec{builddir} path, which is
not what $spec{output} was set to earlier.
The manifest file is always created alongside the DLL, so the correct
fix is simply to append '.manifest' to the DLL path to find the manifest.
(EU-MM does that too.)

Patch taken from [cpan #35943] which reported the same problem. The other
concern raised there, about the VC version being checked to deduce the
existence of the manifest file rather than testing that directly, has
long since been incorporated already and also explains why this problem
has not been seen recently: the faulty attempt to embed the manifest has
not been attempted ever since the existence test was added because it was
also failing and hence no 'mt' command was being run. [cpan #35943] is
thus resolved by this change too.

Bump $VERSION in all ExtUtils::CBuilder files (to 0.280208) to keep them
all in sync as before.
2012-05-28 09:43:01 +01:00
Steve Hay
c2f56b9483 [perl #111782] ExtUtils-CBuilder on Windows does not embed manifests
Correct the test for the existence of the manifest file.
Bump $VERSION in all ExtUtils::CBuilder files (to 0.280207) to keep them
all in sync, as is currently the case.
2012-05-28 08:35:19 +01:00
Chris 'BinGOs' Williams
0518cfa258 Synchronise Module-CoreList in Maintainers.pl for v5.17.0 release 2012-05-27 22:35:02 +01:00
Ricardo Signes
351403ce56 update release schedule; 5.17.3 is Steve Hay 2012-05-27 09:32:27 -04:00
Yves Orton
dee29c6b5b fix [perl #76546] regex engine slowdown bug 2012-05-27 14:51:31 +02:00
Breno G. de Oliveira
f0ccce9ba3 Add missing author for 5.11.2 epigraph 2012-05-26 14:46:22 -07:00
Brian Fraser
032061d233 Fix for [perl #9423] vec assignments generate 2 warnings
Before this commit, this:

    vec(my $v,0,1) = 1;

would've produced four warnings about uninitialized values;
however, the ticket argued that these were spurious.

This commit removes the warning in the case of lvalue vec, since it is
similar to |=, but leaves it in place for rvalue vec.
2012-05-26 14:46:22 -07:00
Brian Fraser
5204593b74 sv.c: Make sv_pvn_force_flags guard against SV_UNDEF_RETURNS_NULL.
Previously, if SV_UNDEF_RETURNS_NULL was passed to sv_pvn_force_flags,
it would call sv_2pv_flags with that flag, and get back a NULL instead
of a char *, which lead to issues.
This commit makes sv_pvn_force_flags use an empty string in that case.
2012-05-26 14:46:21 -07:00
Florian Ragwitz
0371b58d0f CPAN's Term::ReadLine has been synchronised 2012-05-26 23:15:25 +02:00
Father Chrysostomos
393ad6efd2 File::Spec::Unix: Fix pod link 2012-05-26 14:12:56 -07:00
Father Chrysostomos
57ad1cbed2 Add Volker Schatz to AUTHORS 2012-05-26 13:31:30 -07:00
Father Chrysostomos
44b39b705c Increase $File::Spec::Unix::VERSION to 3.39_03 2012-05-26 13:30:36 -07:00
Volker Schatz
593dacfb29 Tests for perl #111510 2012-05-26 13:29:54 -07:00
Volker Schatz
70b6afc16d [perl #111510] File::Spec::UNIX->abs2rel() gets it wrong with ".." components
File::Spec::UNIX->abs2rel() returns wrong results in a few cases, most
of which involve ".." path components.

To reproduce, paste the following test cases into:
perl -MFile::Spec::Unix -n -e 'print File::Spec::Unix->abs2rel(split),"\n";'

../foo bar/bat
bar/bat ../foo
foo bar/../bat
. .
/ /

Correct results when run at /home/me and no symlinks in base path:
../../../foo
../me/bar/bat
../foo
.
.

Results for File::Spec::Unix from PathTols 3.33:
../../foo
../bar/bat
../../../foo
/
/

The error in the first test case is due to an optimisation applied when
both arguments are relative paths, which prepends "/" instead of the
current directory.  "/../" is then converted to "/" by canonpath().

I have replaced this optimisation by a single call to _cwd() in the
following patch.  This also fixes the fourth test case.  Besides, I have
moved checks which make sense only for absolute path arguments to the
first branch of the if.

(hunk @@ -366,28 +367,32 @@)

The error in the last test case arises because a root dir $base is
treated specially, and catdir() does not work well for fewer than two
path components. The first added line in the following patch catches that.

As regards the second and third test case, they can be solved without
consulting the filesystem only if no symlinks are involved.  Whereever
$path contains .. components, the corresponding directory has to be
descended into. The following patch does this.

(hunk @@ -395,19 +400,39 @@)

It can be impossible for abs2rel() to work correctly without looking at
the filesystem if $base contains symlinks.  I understand from the
documentation that the File::Spec modules are not meant to consult the
filesystem.  Even though the docs state that abs2rel() does not consult
the filesystem, the implications could perhaps be made clearer, for
example like this:

(hunk @@ -352,9 +352,10 @@)
2012-05-26 12:32:25 -07:00