At compile time, ck_index with a tainted constant set PL_tainted,
which remained on during the rest of compilation, tainting all other
constants.
Fix this by saving and restoring PL_tainted across the call to
fbm_compile, which is what sets PL_tainted.
OP *kid = cLISTOPo->op_first->op_sibling; /* get past pushmark */
if (kid)
kid = kid->op_sibling; /* get past "big" */
- if (kid && kid->op_type == OP_CONST)
+ if (kid && kid->op_type == OP_CONST) {
+ const bool save_taint = PL_tainted;
fbm_compile(((SVOP*)kid)->op_sv, 0);
+ PL_tainted = save_taint;
+ }
}
return ck_fun(o);
}
ok(tainted C, "constant is tainted properly");
ok(!tainted "", "tainting not broken yet");
index(undef, C);
- local $::TODO = 'breaks when fbm_compile() is called';
ok(!tainted "", "tainting still works after index() of the constant");
}