develooper Front page | perl.perl5.changes | Postings from November 2010

[perl.git] branch blead, updated. v5.13.7-135-ge0aa260

From:
Father Chrysostomos
Date:
November 27, 2010 07:42
Subject:
[perl.git] branch blead, updated. v5.13.7-135-ge0aa260
Message ID:
E1PMMuT-0000uW-Jx@camel.ams6.corp.booking.com
In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/e0aa26060134190dff602c6f37e9d7f75df6b824?hp=6a8c86944bc507200cc01e245d39300e2e6ab775>

- Log -----------------------------------------------------------------
commit e0aa26060134190dff602c6f37e9d7f75df6b824
Author: Father Chrysostomos <sprout@cpan.org>
Date:   Sat Nov 27 07:13:13 2010 -0800

    mro.c: Assert that the previous commit is correct

M	mro.c

commit 06f3ce8671cf9695edecc29f8df95fec541d24ed
Author: Father Chrysostomos <sprout@cpan.org>
Date:   Sat Nov 27 07:11:20 2010 -0800

    Avoid a redundant check in mro.c
    
    This code is never reached if oldstash is a hash without an HvENAME.
    
    So instead of checking oldstash in the ?:, then hvename in the if(),
    we can do one check.
    
    If oldstash is no longer in the symbol table, then this code is never
    reached, because of the if(!fetched_isarev) guard.

M	mro.c

commit 479c6c1fd338d42abb75c5a3b20536d596088a32
Author: Father Chrysostomos <sprout@cpan.org>
Date:   Sat Nov 27 06:42:52 2010 -0800

    Increase overload.pm’s version

M	lib/overload.pm

commit 10b78b9b0da48b3a3f28075f3114621a40a43997
Author: Michael Fig <michael@liveblockauctions.com>
Date:   Sat Nov 27 05:44:26 2010 -0800

    [perl #79680] overload 1.10 sprintf fails taint checking
    
    [Note from the committer: I cannot reproduce the bug this is intended
    to fix. I suspect the author has a botched Scalar::Util installation.
    But it *does* make the code go faster, as it uses fewer ops. That’s my
    reason for appling it.]

M	lib/overload.pm

commit 508fb688b82a062d98e1193644fa7ea9e87552d2
Author: Father Chrysostomos <sprout@cpan.org>
Date:   Sat Nov 27 06:41:40 2010 -0800

    Add Michael Fig to AUTHORS

M	AUTHORS

commit ab9f15865f0bdb3a056da035e63d3297f7c6f3c8
Author: Father Chrysostomos <sprout@cpan.org>
Date:   Sat Nov 27 05:40:53 2010 -0800

    [perl #78716] Bogus read after seek beyond end of string
    
    This is a signedness problem that ffe0bb5ab did not take into account.
    (STRLEN)-10 > 0 returns true for me.

M	ext/PerlIO-scalar/scalar.xs
M	ext/PerlIO-scalar/t/scalar.t
-----------------------------------------------------------------------

Summary of changes:
 AUTHORS                      |    1 +
 ext/PerlIO-scalar/scalar.xs  |    3 ++-
 ext/PerlIO-scalar/t/scalar.t |   11 +++++++++--
 lib/overload.pm              |    4 ++--
 mro.c                        |   19 ++++++++++++-------
 5 files changed, 26 insertions(+), 12 deletions(-)

diff --git a/AUTHORS b/AUTHORS
index 2ef434b..1ec8419 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -716,6 +716,7 @@ Michael Cummings		<mcummings@gentoo.org>
 Michael De La Rue		<mikedlr@tardis.ed.ac.uk>
 Michael van Elst		<mlelstv@serpens.de>
 Michael Engel			<engel@nms1.cc.huji.ac.il>
+Michael Fig			<michael@liveblockauctions.com>
 Michael G Schwern		<schwern@pobox.com>
 Michael H. Moran		<mhm@austin.ibm.com>
 Michael King			<mike808@users.sourceforge.net>
diff --git a/ext/PerlIO-scalar/scalar.xs b/ext/PerlIO-scalar/scalar.xs
index b93b9e9..6fe551d 100644
--- a/ext/PerlIO-scalar/scalar.xs
+++ b/ext/PerlIO-scalar/scalar.xs
@@ -150,7 +150,8 @@ PerlIOScalar_read(pTHX_ PerlIO *f, void *vbuf, Size_t count)
 	PerlIOScalar *s = PerlIOSelf(f, PerlIOScalar);
 	SV *sv = s->var;
 	char *p;
-	STRLEN len, got;
+	STRLEN len;
+	I32 got;
 	p = SvPV(sv, len);
 	got = len - (STRLEN)(s->posn);
 	if (got <= 0)
diff --git a/ext/PerlIO-scalar/t/scalar.t b/ext/PerlIO-scalar/t/scalar.t
index adc5b8e..1aee4b0 100644
--- a/ext/PerlIO-scalar/t/scalar.t
+++ b/ext/PerlIO-scalar/t/scalar.t
@@ -16,7 +16,7 @@ use Fcntl qw(SEEK_SET SEEK_CUR SEEK_END); # Not 0, 1, 2 everywhere.
 
 $| = 1;
 
-use Test::More tests => 69;
+use Test::More tests => 70;
 
 my $fh;
 my $var = "aaa\n";
@@ -276,4 +276,11 @@ EOF
     is($s, ':F:S(GHI):O:F:R:F:R:F:R', 'tied actions - read');
 }
 
-
+# [perl #78716] Seeking beyond the end of the string, then reading
+{
+    my $str = '1234567890';
+    open my $strIn, '<', \$str;
+    seek $strIn, 15, 1;
+    is read($strIn, my $buffer, 5), 0,
+     'seek beyond end end of string followed by read';
+}
diff --git a/lib/overload.pm b/lib/overload.pm
index 31c88b7..37ce236 100644
--- a/lib/overload.pm
+++ b/lib/overload.pm
@@ -1,6 +1,6 @@
 package overload;
 
-our $VERSION = '1.11';
+our $VERSION = '1.12';
 
 sub nil {}
 
@@ -99,7 +99,7 @@ sub AddrRef {
   my $class_prefix = defined($class) ? "$class=" : "";
   my $type = Scalar::Util::reftype($_[0]);
   my $addr = Scalar::Util::refaddr($_[0]);
-  return sprintf("$class_prefix$type(0x%x)", $addr);
+  return sprintf("%s%s(0x%x)", $class_prefix, $type, $addr);
 }
 
 *StrVal = *AddrRef;
diff --git a/mro.c b/mro.c
index 4b90e67..170741c 100644
--- a/mro.c
+++ b/mro.c
@@ -984,13 +984,18 @@ S_mro_gather_and_rename(pTHX_ HV * const stashes, HV * const seen_stashes,
     if(!fetched_isarev) {
 	/* If oldstash is not null, then we can use its HvENAME to look up
 	   the isarev hash, since all its subclasses will be listed there.
+	   It will always have an HvENAME. It the HvENAME was removed
+	   above, then fetch_isarev will be true, and this code will not be
+	   reached.
 
-	   If oldstash is null or is no longer in the symbol table, then
-	   this is an empty spot with no stash in it, so subclasses could
-	   be listed in isarev hashes belonging to any of the names, so we
-	   have to check all of them. */
-	char *hvename = oldstash ? HvENAME(oldstash) : NULL;
-	if (hvename) {
+	   If oldstash is null, then this is an empty spot with no stash in
+	   it, so subclasses could be listed in isarev hashes belonging to
+	   any of the names, so we have to check all of them.
+	 */
+	assert(!oldstash || HvENAME(oldstash));
+	if (oldstash) {
+	    /* Extra variable to avoid a compiler warning */
+	    char * const hvename = HvENAME(oldstash);
 	    fetched_isarev = TRUE;
 	    svp = hv_fetch(PL_isarev, hvename, HvENAMELEN_get(oldstash), 0);
 	    if (svp) isarev = MUTABLE_HV(*svp);

--
Perl5 Master Repository



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About