oi->size = 0;
}
- s = SvPV_const(sv, len);
+ if (sv) {
+ s = SvPV_const(sv, len);
+ } else {
+ s = "{";
+ len = 1;
+ }
+
if (len > oi->size) {
Safefree(oi->buf);
Newx(oi->buf, len, char);
oi->size = len;
}
Copy(s, oi->buf, len, char);
+
oi->len = len;
oi->pos = src;
oi->line = line;
return o;
}
+/* ... ck_scope ............................................................ */
+
+STATIC OP *(*indirect_old_ck_scope) (pTHX_ OP *) = 0;
+STATIC OP *(*indirect_old_ck_lineseq)(pTHX_ OP *) = 0;
+
+STATIC OP *indirect_ck_scope(pTHX_ OP *o) {
+ OP *(*old_ck)(pTHX_ OP *) = 0;
+
+ switch (o->op_type) {
+ case OP_SCOPE: old_ck = indirect_old_ck_scope; break;
+ case OP_LINESEQ: old_ck = indirect_old_ck_lineseq; break;
+ }
+ o = CALL_FPTR(old_ck)(aTHX_ o);
+
+ if (indirect_hint()) {
+ indirect_map_store(o, PL_oldbufptr, NULL, CopLINE(&PL_compiling));
+ return o;
+ }
+
+ indirect_map_delete(o);
+ return o;
+}
+
+/* We don't need to clean the map entries for leave ops because they can only
+ * be created by mutating from a lineseq. */
+
/* ... ck_method ........................................................... */
STATIC OP *(*indirect_old_ck_method)(pTHX_ OP *) = 0;
case OP_CONST:
case OP_RV2SV:
case OP_PADSV:
+ case OP_SCOPE:
+ case OP_LEAVE:
break;
default:
goto done;
PL_check[OP_RV2SV] = MEMBER_TO_FPTR(indirect_ck_rv2sv);
indirect_old_ck_padany = PL_check[OP_PADANY];
PL_check[OP_PADANY] = MEMBER_TO_FPTR(indirect_ck_padany);
+ indirect_old_ck_scope = PL_check[OP_SCOPE];
+ PL_check[OP_SCOPE] = MEMBER_TO_FPTR(indirect_ck_scope);
+ indirect_old_ck_lineseq = PL_check[OP_LINESEQ];
+ PL_check[OP_LINESEQ] = MEMBER_TO_FPTR(indirect_ck_scope);
+
indirect_old_ck_method = PL_check[OP_METHOD];
PL_check[OP_METHOD] = MEMBER_TO_FPTR(indirect_ck_method);
indirect_old_ck_entersub = PL_check[OP_ENTERSUB];