Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[perl.git] branch blead, updated. v5.11.2-76-gbc79561

0 views
Skip to first unread message

Jesse Vincent

unread,
Nov 25, 2009, 2:31:34 PM11/25/09
to perl5-...@perl.org
In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/bc795616b74a72425cddf467dbdc6e65bc76484b?hp=860054a89b3735a633f33a7a3fc99a8642e76384>

- Log -----------------------------------------------------------------
commit bc795616b74a72425cddf467dbdc6e65bc76484b
Author: Jesse Vincent <je...@bestpractical.com>
Date: Wed Nov 25 13:47:38 2009 -0500

Moved the original test file from the previous patch into t/op/lex.t,

Aded details on the bug it fixes to the tests.

M MANIFEST
D t/comp/interpolate.t
M t/op/lex.t

commit f706d24c20941a6401e90643488acaa0705ba877
Author: Gerard Goossen <ger...@ggoossen.net>
Date: Tue Nov 24 12:13:13 2009 +0100

add interpolation test for [perl #70091]

(Updated by Jesse Vincent to put the test in comp rather than a new
toplevel test directory)

M MANIFEST
A t/comp/interpolate.t

commit ae28bb2a75e3c50332b2684a214bf3dcd1bdb937
Author: Gerard Goossen <ger...@ggoossen.net>
Date: Tue Nov 24 12:06:55 2009 +0100

Also skip spaces after variable if we are within lexical brackets. Fixes #70091: Segmentation fault in hash lookup in regex substitution

M toke.c

commit e190e9b4a60aee60dfa0e20320d818bc26b18432
Author: Gerard Goossen <ger...@ggoossen.net>
Date: Tue Nov 24 11:27:04 2009 +0100

Add assertions that pp_padav and pp_padhv push scalars of the correct type.

M pp.c
-----------------------------------------------------------------------

Summary of changes:
pp.c | 2 ++
t/op/lex.t | 29 +++++++++++++++++++++++++++--
toke.c | 2 +-
3 files changed, 30 insertions(+), 3 deletions(-)

diff --git a/pp.c b/pp.c
index b271e7b..292feb6 100644
--- a/pp.c
+++ b/pp.c
@@ -63,6 +63,7 @@ PP(pp_padav)
{
dVAR; dSP; dTARGET;
I32 gimme;
+ assert(SvTYPE(TARG) == SVt_PVAV);
if (PL_op->op_private & OPpLVAL_INTRO)
if (!(PL_op->op_private & OPpPAD_STATE))
SAVECLEARSV(PAD_SVl(PL_op->op_targ));
@@ -106,6 +107,7 @@ PP(pp_padhv)
dVAR; dSP; dTARGET;
I32 gimme;

+ assert(SvTYPE(TARG) == SVt_PVHV);
XPUSHs(TARG);
if (PL_op->op_private & OPpLVAL_INTRO)
if (!(PL_op->op_private & OPpPAD_STATE))
diff --git a/t/op/lex.t b/t/op/lex.t
index 3f00248..0789077 100644
--- a/t/op/lex.t
+++ b/t/op/lex.t
@@ -1,9 +1,10 @@
-#!perl -w
+#!perl
use strict;
+use warnings;

require './test.pl';

-plan(tests => 2);
+plan(tests => 4);

{
no warnings 'deprecated';
@@ -20,3 +21,27 @@ $yow
}

curr_test(3);
+
+
+{
+ my %foo = (aap => "monkey");
+ my $foo = '';
+ is("@{[$foo{'aap'}]}", 'monkey', 'interpolation of hash lookup with space between lexical variable and subscript');
+ is("@{[$foo {'aap'}]}", 'monkey', 'interpolation of hash lookup with space between lexical variable and subscript - test for [perl #70091]');
+
+# Original bug report [perl #70091]
+# #!perl
+# use warnings;
+# my %foo;
+# my $foo = '';
+# (my $tmp = $foo) =~ s/^/$foo {$0}/e;
+# __END__
+#
+# This program causes a segfault with 5.10.0 and 5.10.1.
+#
+# The space between '$foo' and '{' is essential, which is why piping
+# it through perl -MO=Deparse "fixes" it.
+#
+
+}
+
diff --git a/toke.c b/toke.c
index a4e9471..f214ddf 100644
--- a/toke.c
+++ b/toke.c
@@ -5441,7 +5441,7 @@ Perl_yylex(pTHX)
d = s;
{
const char tmp = *s;
- if (PL_lex_state == LEX_NORMAL)
+ if (PL_lex_state == LEX_NORMAL || PL_lex_brackets)
s = SKIPSPACE1(s);

if ((PL_expect != XREF || PL_oldoldbufptr == PL_last_lop)

--
Perl5 Master Repository

0 new messages