summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-10-29 00:34:17 -0700
committerFather Chrysostomos <sprout@cpan.org>2011-10-29 00:34:17 -0700
commitac0dcfaef6347918fec76edc4f9ee82e20f739b0 (patch)
tree5b3c1ce82616c8ffc382930e335ef97314fb0ea6
parent6a6066037df54aa9beec0713dc9647c124733d10 (diff)
downloadperl-ac0dcfaef6347918fec76edc4f9ee82e20f739b0.tar.gz
Oops: Fix Glob.xs assertion failure
This happens under :bsd_glob when <>/glob is called in list context.
-rw-r--r--ext/File-Glob/Glob.xs6
-rw-r--r--ext/File-Glob/t/basic.t3
2 files changed, 6 insertions, 3 deletions
diff --git a/ext/File-Glob/Glob.xs b/ext/File-Glob/Glob.xs
index 2fed73bdcd..11717697e9 100644
--- a/ext/File-Glob/Glob.xs
+++ b/ext/File-Glob/Glob.xs
@@ -93,8 +93,10 @@ iterate(pTHX_ bool(*globber)(pTHX_ SV *entries, SV *patsv))
}
/* chuck it all out, quick or slow */
- assert(SvROK(entriesv));
- entries = (AV *)SvRV(entriesv);
+ if (!on_stack) {
+ assert(SvROK(entriesv));
+ entries = (AV *)SvRV(entriesv);
+ }
if (gimme == G_ARRAY) {
if (!on_stack) {
Copy(AvARRAY(entries), SP+1, AvFILLp(entries)+1, SV *);
diff --git a/ext/File-Glob/t/basic.t b/ext/File-Glob/t/basic.t
index 3fab895966..bcd9999621 100644
--- a/ext/File-Glob/t/basic.t
+++ b/ext/File-Glob/t/basic.t
@@ -10,7 +10,7 @@ BEGIN {
}
}
use strict;
-use Test::More tests => 48;
+use Test::More tests => 49;
BEGIN {use_ok('File::Glob', ':glob')};
use Cwd ();
@@ -281,3 +281,4 @@ for (qw[
}
is <a b>, 'a b', '<a b> under :bsd_glob';
is <"a" "b">, '"a" "b"', '<"a" "b"> under :bsd_glob';
+is_deeply [<a b>], [q<a b>], '<> in list context under :bsd_glob';