Change 33880 by [EMAIL PROTECTED] on 2008/05/20 12:15:13
Integrate:
[ 33770]
Subject: [PATCH] Double magic/warnings with tie $x, $m
From: "Vincent Pit" <[EMAIL PROTECTED]>
Date: Wed, 30 Apr 2008 13:14:00 +0200 (CEST)
Message-ID: <[EMAIL PROTECTED]>
[ 33831]
Subject: Re: [PATCH] Double magic with chop
From: "Vincent Pit" <[EMAIL PROTECTED]>
Date: Thu, 15 May 2008 15:31:19 +0200 (CEST)
Message-ID: <[EMAIL PROTECTED]>
Affected files ...
... //depot/maint-5.10/perl/doop.c#3 integrate
... //depot/maint-5.10/perl/pp_sys.c#5 integrate
... //depot/maint-5.10/perl/t/lib/warnings/9uninit#3 integrate
... //depot/maint-5.10/perl/t/op/gmagic.t#2 integrate
Differences ...
==== //depot/maint-5.10/perl/doop.c#3 (text) ====
Index: perl/doop.c
--- perl/doop.c#2~33139~ 2008-01-30 15:19:42.000000000 -0800
+++ perl/doop.c 2008-05-20 05:15:13.000000000 -0700
@@ -1011,7 +1011,7 @@
s = SvPV(sv, len);
if (len && !SvPOK(sv))
- s = SvPV_force(sv, len);
+ s = SvPV_force_nomg(sv, len);
if (DO_UTF8(sv)) {
if (s && len) {
char * const send = s + len;
==== //depot/maint-5.10/perl/pp_sys.c#5 (text) ====
Index: perl/pp_sys.c
--- perl/pp_sys.c#4~33641~ 2008-04-03 09:39:03.000000000 -0700
+++ perl/pp_sys.c 2008-05-20 05:15:13.000000000 -0700
@@ -821,7 +821,7 @@
break;
}
items = SP - MARK++;
- if (sv_isobject(*MARK)) {
+ if (sv_isobject(*MARK)) { /* Calls GET magic. */
ENTER;
PUSHSTACKi(PERLSI_MAGIC);
PUSHMARK(SP);
@@ -835,10 +835,12 @@
/* Not clear why we don't call call_method here too.
* perhaps to get different error message ?
*/
- stash = gv_stashsv(*MARK, 0);
+ STRLEN len;
+ const char *name = SvPV_nomg_const(*MARK, len);
+ stash = gv_stashpvn(name, len, 0);
if (!stash || !(gv = gv_fetchmethod(stash, methname))) {
DIE(aTHX_ "Can't locate object method \"%s\" via package
\"%"SVf"\"",
- methname, SVfARG(*MARK));
+ methname, SVfARG(SvOK(*MARK) ? *MARK : &PL_sv_no));
}
ENTER;
PUSHSTACKi(PERLSI_MAGIC);
==== //depot/maint-5.10/perl/t/lib/warnings/9uninit#3 (text) ====
Index: perl/t/lib/warnings/9uninit
--- perl/t/lib/warnings/9uninit#2~33726~ 2008-04-22 08:18:16.000000000
-0700
+++ perl/t/lib/warnings/9uninit 2008-05-20 05:15:13.000000000 -0700
@@ -1132,7 +1132,6 @@
eval { my $x; sysread $m1, $x, $g1, $g2 };
EXPECT
Use of uninitialized value $m1 in tie at - line 5.
-Use of uninitialized value $m1 in tie at - line 5.
Use of uninitialized value $m1 in ref-to-glob cast at - line 7.
Use of uninitialized value $g1 in read at - line 7.
Use of uninitialized value $m1 in ref-to-glob cast at - line 8.
==== //depot/maint-5.10/perl/t/op/gmagic.t#2 (text) ====
Index: perl/t/op/gmagic.t
--- perl/t/op/gmagic.t#1~32694~ 2007-12-22 01:23:09.000000000 -0800
+++ perl/t/op/gmagic.t 2008-05-20 05:15:13.000000000 -0700
@@ -6,7 +6,7 @@
@INC = '../lib';
}
-print "1..18\n";
+print "1..20\n";
my $t = 1;
tie my $c => 'Tie::Monitor';
@@ -50,6 +50,10 @@
$s = $c = $c . $c;
ok_string($s, '00', 3, 1);
+# multiple magic in core functions
+$s = chop($c);
+ok_string($s, '0', 1, 1);
+
# adapted from Tie::Counter by Abigail
package Tie::Monitor;
End of Patch.