summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2003-07-08 20:26:20 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2003-07-08 20:26:20 +0000
commit463d09e6aae174eaf79dbe628f27cb752bc2f77b (patch)
tree845a46b23a6a2a5162cbeff1fa43dd0dcdb7186a /op.c
parentbe17bf04ae90bd9018133c867f86b22ba0016128 (diff)
downloadperl-463d09e6aae174eaf79dbe628f27cb752bc2f77b.tar.gz
The CHECKOP macro was not invoked on some newly created ops
(to match them against the current opmask.) As a consequence, Safe compartments were unable to trap some ops (pattern match, slices, conditionals.) This fixes the holes. p4raw-id: //depot/perl@20079
Diffstat (limited to 'op.c')
-rw-r--r--op.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/op.c b/op.c
index 70f5160ff1..304cf4695f 100644
--- a/op.c
+++ b/op.c
@@ -2174,7 +2174,7 @@ Perl_newLISTOP(pTHX_ I32 type, I32 flags, OP *first, OP *last)
listop->op_last = pushop;
}
- return (OP*)listop;
+ return CHECKOP(type, listop);
}
OP *
@@ -2611,7 +2611,7 @@ Perl_newPMOP(pTHX_ I32 type, I32 flags)
PmopSTASH_set(pmop,PL_curstash);
}
- return (OP*)pmop;
+ return CHECKOP(type, pmop);
}
OP *
@@ -3417,6 +3417,8 @@ S_new_logop(pTHX_ I32 type, I32 flags, OP** firstp, OP** otherp)
first->op_next = (OP*)logop;
first->op_sibling = other;
+ CHECKOP(type,logop);
+
o = newUNOP(OP_NULL, 0, (OP*)logop);
other->op_next = o;
@@ -3461,6 +3463,8 @@ Perl_newCONDOP(pTHX_ I32 flags, OP *first, OP *trueop, OP *falseop)
logop->op_other = LINKLIST(trueop);
logop->op_next = LINKLIST(falseop);
+ CHECKOP(OP_COND_EXPR, /* that's logop->op_type */
+ logop);
/* establish postfix order */
start = LINKLIST(first);