Message-ID: <14072.16859.154428.241373@fre-76-120.reshall.berkeley.edu>
p4raw-id: //depot/perl@3164
case OA_GVOP:
return OPc_GVOP;
- case OA_PVOP:
- return OPc_PVOP;
+ case OA_PVOP_OR_SVOP:
+ /*
+ * 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
+ * (i.e., an RV pointing to an HV).
+ */
+ return (o->op_private & (OPpTRANS_TO_UTF|OPpTRANS_FROM_UTF))
+ ? OPc_SVOP : OPc_PVOP;
case OA_LOOP:
return OPc_LOOP;
#define OA_PMOP (6 << 8)
#define OA_SVOP (7 << 8)
#define OA_GVOP (8 << 8)
-#define OA_PVOP (9 << 8)
+#define OA_PVOP_OR_SVOP (9 << 8)
#define OA_LOOP (10 << 8)
#define OA_COP (11 << 8)
#define OA_BASEOP_OR_UNOP (12 << 8)
'/', 6, # pmop
'$', 7, # svop
'*', 8, # gvop
- '"', 9, # pvop
+ '"', 9, # pvop_or_svop
'{', 10, # loop
';', 11, # cop
'%', 12, # baseop_or_unop