assert that you aren't assigning to the NVX of an AV or HV
[p5sagit/p5-mst-13.2.git] / hv.h
diff --git a/hv.h b/hv.h
index 3115dba..6378a02 100644 (file)
--- a/hv.h
+++ b/hv.h
@@ -29,6 +29,10 @@ struct hek {
        is UTF-8 */
 };
 
+struct shared_he {
+    struct he shared_he_he;
+    struct hek shared_he_hek;
+};
 
 /* Subject to change.
    Don't access this directly.
@@ -360,6 +364,13 @@ C<SV*>.
 #define Perl_sharepvn(sv, len, hash) HEK_KEY(share_hek(sv, len, hash))
 #define sharepvn(sv, len, hash)             Perl_sharepvn(sv, len, hash)
 
+#define share_hek_hek(hek)                                             \
+    (++(((struct shared_he *)(((char *)hek)                            \
+                             - STRUCT_OFFSET(struct shared_he,         \
+                                             shared_he_hek)))          \
+       ->shared_he_he.hent_val),                                       \
+     hek)
+
 /*
  * Local variables:
  * c-indentation-style: bsd