summaryrefslogtreecommitdiff
path: root/ext/arybase
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-10-26 18:02:58 -0700
committerFather Chrysostomos <sprout@cpan.org>2011-10-26 20:16:57 -0700
commit02523b6e704bc628e99f1b8739226559c7181e42 (patch)
tree67fdd6bbc6e663a2f2ed4550a288d4c7a46c81a7 /ext/arybase
parent546dd830d08e285bd00ae6191388f21e8ee3ab44 (diff)
downloadperl-02523b6e704bc628e99f1b8739226559c7181e42.tar.gz
arybase.xs: Always check the op type in ck_*
Sometimes the previous check function will have replaced the op with one of a different type. In that case, the rest of arybase’s check function does not apply and can even cause a crash for ops with no children (e.g., $x=wait is optimised down to a simple wait op with no children and with op_targ pointing to $x, if it is lexical).
Diffstat (limited to 'ext/arybase')
-rw-r--r--ext/arybase/arybase.xs8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/arybase/arybase.xs b/ext/arybase/arybase.xs
index a2806dd19c..5c653e3f2d 100644
--- a/ext/arybase/arybase.xs
+++ b/ext/arybase/arybase.xs
@@ -166,23 +166,23 @@ STATIC void ab_process_assignment(pTHX_ OP *left, OP *right) {
STATIC OP *ab_ck_sassign(pTHX_ OP *o) {
o = (*ab_old_ck_sassign)(aTHX_ o);
- {
+ if (o->op_type == OP_SASSIGN) {
OP *right = cBINOPx(o)->op_first;
OP *left = right->op_sibling;
if (left) ab_process_assignment(left, right);
- return o;
}
+ return o;
}
STATIC OP *ab_ck_aassign(pTHX_ OP *o) {
o = (*ab_old_ck_aassign)(aTHX_ o);
- {
+ if (o->op_type == OP_AASSIGN) {
OP *right = cBINOPx(o)->op_first;
OP *left = cBINOPx(right->op_sibling)->op_first->op_sibling;
right = cBINOPx(right)->op_first->op_sibling;
ab_process_assignment(left, right);
- return o;
}
+ return o;
}
void