| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If an overload method is itself blessed into a class that has
overloaded operators but does not have fallback enabled, then an error
is produced:
$ perl5.10.0
use overload '+' => sub{};
bless overload::Method main => '+';
overload::Method main => '+';
^D
Operation "ne": no method found,
left argument in overloaded package main,
right argument has no overloaded magic at /usr/local/lib/perl5/5.10.0/
overload.pm line 59.
The attached patch fixes this.
|
|
|
|
| |
[perl #76138].
|
|
|
|
|
|
| |
22afb09b13a6dc17f20388991422fdbe6166e3ed
As is() doesn't stringify its arguments anymore we have to.
|
|
|
|
|
|
|
|
|
| |
Feature Changes
* is() and others will no longer stringify its arguments before
comparing. Overloaded objects will make use of their eq
overload rather than their "" overload. This can break tests of
impolitely string overloaded objects. DateTime prior to 0.54 is
the biggest example.
|
|
|
|
|
| |
some of the filetest operators could call mg_get and/or overload fallback
stringify multiple times
|
|
|
|
|
| |
/$tied/ called FETCH too many times if the FETCH returned an overloaded
object with no qr method, but with stringify fallback
|
|
|
|
|
| |
It turns out that the number of FETCHes for the fallback ($tied_ovld . foo)
just needed explaining, not fixing.
|
|
|
|
|
|
|
| |
There was a piece of code in pp_concat who's job it was to determine the
UT8ness of the LHS, and it did it in a heavy-handed way to cope with the
special case of a regexp (which is an RV pointing to REGEXP which might
be UTF8)
|
|
|
|
|
|
| |
string eval would check its arg for taint before processing magic, overload
etc. If the magic or overload returned a tainted value, it wouldn't
be detected. Fixes part of #75716.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Sometimes when an overload method returned a tainted value, that
taintedness got lost. This fixes #75716: overload removes tainting.
It also considerably expands the tied series of tests in overload.t.
It now taints the return value, and checks for correct taintedness.
It also tests against two overload packages: the new one only has fallback
methods, which affects the return path for the tainted value.
It now also compares the expected (non-tied, non-overload) expression
value against a overloaded version of that expression in addition to
versions where a tied var returned an overloaded object; e.g. in these
expressions:
1: 1 + $plain_value
2: 1 + $overloaded_var
3: 1 + $tied_scalar_that_returns_overloaded_value
4: 1 + $tied_array_whose element_0_holds_an_overloaded_value[0]
then the value of expression 1 is compared against each of 2,3,4, whereas
before it was only compared against 3,4.
|
|
|
|
|
|
|
|
|
| |
Stick a -T at the top of lib/overload.t in preparation for adding some
taint tests later. This causes some of the current tests to fail, since
the FETCH count has changed: so we fix those up too. They change because
under taint, code like ${$x} is compiled as enter/gvsv/leave/rv2sv rather
than gvsv/rv2sv (see Perl_scope), and the leave creates a mortal copy of
the tied value, avoiding any further fetches.
|
|
|
|
|
|
| |
pp_entersub checked for ROK *before* calling magic. If the tied scalar
already had ROK set (perhaps from a previous time), then get magic (and
hence FETCH) wasn't called.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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, <>.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Specifically:
1: / returns and NV where possible, only returning an integer if the dividend
is an integer larger than an NV can represent accurately, and integer
division is exact (ie no fractional part/remainder).
2: The test is performing $ref/1, intending it to be an identity operation
on the numeric value of the reference.
3: The test assumes that the return result of the division will be a number
that stringifies identically to the integer value of the reference.
The fails if both:
1: The system memory map is such that addresses are very large (ia64 does)
2: NVs are large enough to hold these addresses
because then the address becomes converted to an NV which has sufficient
decimal digits that stringification defaults to scientific notation.
Itanium Linux users the world over will be cheering because they can now
compile Perl with long doubles with confidence that all tests pass.
|
| |
|
|
|
|
|
|
| |
- Fix test for error message
- Add negative test cases
- Remove unneeded evals
|
|
|
|
|
|
|
|
|
|
|
| |
If this is defined, it will be called instead of stringification
whenever an object is used as a regexp or interpolated into a regexp.
This will fall back to stringification even without C<fallback => 1>,
for compatibility.
An overloaded 'qr' must return either a REGEXP or a ref to a REGEXP
(such as created by qr//). Any further overloading on the return value
will be ignored.
|
| |
|
|
|
|
|
| |
Message-ID: <48B86060.4090905@profvince.com>
p4raw-id: //depot/perl@34310
|
|
|
|
|
|
| |
From: Rick Delaney (via RT) <perlbug-followup@perl.org>
Message-ID: <rt-3.6.HEAD-22068-1213469460-652.55786-75-0@perl.org>
p4raw-id: //depot/perl@34055
|
|
|
|
|
| |
(and related changes)
p4raw-id: //depot/perl@32880
|
|
|
| |
p4raw-id: //depot/perl@32751
|
|
|
|
|
| |
(Correct a comparison of $] with 5.011 in B.pm)
p4raw-id: //depot/perl@32740
|
|
|
|
|
|
| |
From: "Jerry D. Hedden" <jdhedden@cpan.org>
Message-ID: <1ff86f510710181149s1c096dd9qffa8fe42046e675b@mail.gmail.com>
p4raw-id: //depot/perl@32141
|
|
|
|
|
| |
on HP-UX (see bug #46011)
p4raw-id: //depot/perl@32071
|
|
|
|
|
| |
Message-ID: <20071008023701.GI29047@bort.ca>
p4raw-id: //depot/perl@32062
|
|
|
|
|
| |
Message-ID: <20071007042214.GH29047@bort.ca>
p4raw-id: //depot/perl@32059
|
|
|
|
|
| |
spelling, grammar and capitalisation imperfections.
p4raw-id: //depot/perl@32017
|
|
|
|
|
|
|
|
|
|
|
|
| |
stored on the reference rather than the referent. Despite the fact that
objects can only be accessed via references (even internally), the
referent actually knows that it's blessed, not the references. So
taking a new, unrelated, reference to it gives an object. However, the
overloading-or-not flag was on the reference prior to 5.10, and taking
a new reference didn't (use to) copy it (prior to 5.8.9).
So test that the bug can't return - overloading should work on a
reference to something already blessed into a package with overloading.
p4raw-id: //depot/perl@32016
|
|
|
|
|
| |
Message-ID: <20070221215316.GF5646@bort.ca>
p4raw-id: //depot/perl@30383
|
|
|
|
|
|
| |
From: "Adriano Rodrigues" <a.r.ferreira@gmail.com>
Message-ID: <73ddeb6c0611231143y1e3461dbqf30f5fce16698b5c@mail.gmail.com>
p4raw-id: //depot/perl@29373
|
|
|
| |
p4raw-id: //depot/perl@27510
|
|
|
| |
p4raw-id: //depot/perl@27508
|
|
|
|
|
| |
(re)?blessing of overloaded objects to work correctly.
p4raw-id: //depot/perl@27506
|
|
|
| |
p4raw-id: //depot/perl@27505
|
|
|
| |
p4raw-id: //depot/perl@27504
|
|
|
| |
p4raw-id: //depot/perl@27502
|
|
|
| |
p4raw-id: //depot/perl@27501
|
|
|
|
|
| |
Message-ID: <20051226175648.GA28402@rpc142.cs.man.ac.uk>
p4raw-id: //depot/perl@26521
|
|
|
|
|
|
|
| |
badly with overloading
Message-ID: <20041104004616.GA11214@biff.bort.ca>
p4raw-id: //depot/perl@23470
|
|
|
|
|
|
| |
having decided that it wasn't a correct fix for bug #31793.
p4raw-link: @23347 on //depot/perl: d411a6a9eb5df09116806ed1c441d30d37e8d5e8
p4raw-id: //depot/perl@23469
|
|
|
| |
p4raw-id: //depot/perl@23357
|
|
|
|
|
| |
Message-ID: <20041002050448.GB5059@biff.bort.ca>
p4raw-id: //depot/perl@23347
|
|
|
|
|
| |
that are overloaded.
p4raw-id: //depot/perl@23106
|
|
|
|
|
|
|
|
| |
Subject: [PATCH] Config{extensions} uses filesystem names as extensions
Message-ID: <Pine.SOL.4.58.0406241505530.14039@maxwell.phys.lafayette.edu>
with improvements from Marcus Holland-Moritz
p4raw-id: //depot/perl@22998
|
|
|
| |
p4raw-id: //depot/perl@22967
|
|
|
|
|
|
|
|
|
|
|
|
| |
From: Abigail <abigail@abigail.nl>
Date: Mon, 27 Oct 2003 13:05:37 +0100
Message-ID: <20031027120536.GA24608@abigail.nl>
Subject: [PATCH bleadperl] [perl #24313] (was Re: [PATCH lib/overload.t] TODO tests for bug #24313.)
From: Rick Delaney <rick@bort.ca>
Date: Mon, 27 Oct 2003 12:17:49 -0500
Message-ID: <20031027121749.E2233@biff.bort.ca>
p4raw-id: //depot/perl@21566
|
|
|
|
|
|
|
|
|
| |
Message-ID: <20030101225459.A2320@cs839290-a.mtth.phub.net.cable.rogers.com>
(Pity the first patch fell through the cracks back then.
Not that forbidding non-object copy constructors is the right
thing to do but the bug could use fixing.)
p4raw-id: //depot/perl@21276
|
|
|
|
|
|
| |
From: "fergal@esatclear.ie (via RT)" <perlbug-followup@perl.org>
Message-ID: <rt-22753-59662.14.6066295633041@rt.perl.org>
p4raw-id: //depot/perl@19840
|
|
|
|
|
|
|
|
| |
Date: Wed, 04 Sep 2002 21:09:01 -0700
Message-ID: <djtd9gzkgyLd092yn@efn.org>
Date: Fri, 06 Sep 2002 09:23:03 -0700
Message-ID: <nZNe9gzkgKdH092yn@efn.org>
p4raw-id: //depot/perl@17864
|