+/* This pp replacement is actually only called for topmost exists/delete ops,
+ * because we hijack the [ah]elem check functions and this disables the
+ * optimization for lvalue and rvalue dereferencing. In particular, the
+ * OPf_MOD branches should never be covered. In the future, the multideref
+ * optimization might also be disabled for custom exists/delete check functions,
+ * which will make this section unnecessary. However, the code tries to be as
+ * general as possible in case I think of a way to reenable the multideref
+ * optimization even when this module is in use. */
+
+static UV a_do_multideref(const OP *o, UV flags) {
+ UV isexdel, other_flags;
+
+ assert(o->op_type == OP_MULTIDEREF);
+
+ other_flags = flags & ~A_HINT_DO;
+
+ isexdel = o->op_private & (OPpMULTIDEREF_EXISTS|OPpMULTIDEREF_DELETE);
+ if (isexdel) {
+ if (isexdel & OPpMULTIDEREF_EXISTS) {
+ flags &= A_HINT_EXISTS;
+ } else {
+ flags &= A_HINT_DELETE;
+ }
+ } else {
+ if (o->op_flags & OPf_MOD) {
+ flags &= A_HINT_STORE;
+ } else {
+ flags &= A_HINT_FETCH;
+ }
+ }
+
+ return flags ? (flags | other_flags) : 0;
+}
+