projects
/
platform
/
upstream
/
perl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4e7fd22
)
arybase.xs: Check that $[ is in the main stash
author
Father Chrysostomos
<sprout@cpan.org>
Thu, 17 Nov 2011 17:35:53 +0000
(09:35 -0800)
committer
Father Chrysostomos
<sprout@cpan.org>
Thu, 17 Nov 2011 18:22:24 +0000
(10:22 -0800)
Check that $[ is in the main stash before doing anything magical with
$[=1. This can only be in another stash if some other XS module has
overridden the check functions to change $[ to $foo::[. But robust-
ness is good, right?
ext/arybase/arybase.xs
patch
|
blob
|
history
diff --git
a/ext/arybase/arybase.xs
b/ext/arybase/arybase.xs
index
5c653e3
..
7cee0dc
100644
(file)
--- a/
ext/arybase/arybase.xs
+++ b/
ext/arybase/arybase.xs
@@
-137,6
+137,7
@@
STATIC bool ab_op_is_dollar_bracket(pTHX_ OP *o) {
return o->op_type == OP_RV2SV && (o->op_flags & OPf_KIDS)
&& (c = cUNOPx(o)->op_first)
&& c->op_type == OP_GV
+ && GvSTASH(cGVOPx_gv(c)) == PL_defstash
&& strEQ(GvNAME(cGVOPx_gv(c)), "[");
}