* Character translations (tr///) are usually a PVOP, keeping a
* pointer to a table of shorts used to look up translations.
* Under utf8, however, a simple table isn't practical; instead,
- * the OP is an SVOP, and the SV is a reference to a swash
+ * the OP is an SVOP (or, under threads, a PADOP),
+ * and the SV is a reference to a swash
* (i.e., an RV pointing to an HV).
*/
return (o->op_private & (OPpTRANS_TO_UTF|OPpTRANS_FROM_UTF))
+#if defined(USE_ITHREADS) \
+ && (PERL_VERSION > 8 || (PERL_VERSION == 8 && PERL_SUBVERSION >= 9))
+ ? OPc_PADOP : OPc_PVOP;
+#else
? OPc_SVOP : OPc_PVOP;
+#endif
case OA_LOOP:
return OPc_LOOP;
is(B::svref_2object(sub {})->ROOT->ppaddr, 'PL_ppaddr[OP_LEAVESUB]',
'OP->ppaddr');
+# This one crashes from perl 5.8.9 to B 1.24 (perl 5.13.6):
+B::svref_2object(sub{y/\x{100}//})->ROOT->first->first->sibling->sv;
+ok 1, 'B knows that UTF trans is a padop in 5.8.9, not an svop';
+
done_testing();