[set] Protect against immutible null set with invertible addition
diff --git a/src/hb-map.cc b/src/hb-map.cc
index 6757535..388e678 100644
--- a/src/hb-map.cc
+++ b/src/hb-map.cc
@@ -188,6 +188,7 @@
 	    hb_codepoint_t  key,
 	    hb_codepoint_t  value)
 {
+  /* Immutable-safe. */
   map->set (key, value);
 }
 
@@ -220,6 +221,7 @@
 hb_map_del (hb_map_t       *map,
 	    hb_codepoint_t  key)
 {
+  /* Immutable-safe. */
   map->del (key);
 }
 
diff --git a/src/hb-set.cc b/src/hb-set.cc
index eb6f41e..f9bc858 100644
--- a/src/hb-set.cc
+++ b/src/hb-set.cc
@@ -254,6 +254,7 @@
 hb_set_add (hb_set_t       *set,
 	    hb_codepoint_t  codepoint)
 {
+  /* Immutible-safe. */
   set->add (codepoint);
 }
 
@@ -273,6 +274,7 @@
 		  hb_codepoint_t  first,
 		  hb_codepoint_t  last)
 {
+  /* Immutible-safe. */
   set->add_range (first, last);
 }
 
@@ -289,6 +291,7 @@
 hb_set_del (hb_set_t       *set,
 	    hb_codepoint_t  codepoint)
 {
+  /* Immutible-safe. */
   set->del (codepoint);
 }
 
@@ -311,6 +314,7 @@
 		  hb_codepoint_t  first,
 		  hb_codepoint_t  last)
 {
+  /* Immutible-safe. */
   set->del_range (first, last);
 }
 
@@ -364,6 +368,9 @@
 hb_set_set (hb_set_t       *set,
 	    const hb_set_t *other)
 {
+  if (unlikely (hb_object_is_immutable (set)))
+    return;
+
   set->set (*other);
 }
 
@@ -380,6 +387,9 @@
 hb_set_union (hb_set_t       *set,
 	      const hb_set_t *other)
 {
+  if (unlikely (hb_object_is_immutable (set)))
+    return;
+
   set->union_ (*other);
 }
 
@@ -396,6 +406,9 @@
 hb_set_intersect (hb_set_t       *set,
 		  const hb_set_t *other)
 {
+  if (unlikely (hb_object_is_immutable (set)))
+    return;
+
   set->intersect (*other);
 }
 
@@ -412,6 +425,9 @@
 hb_set_subtract (hb_set_t       *set,
 		 const hb_set_t *other)
 {
+  if (unlikely (hb_object_is_immutable (set)))
+    return;
+
   set->subtract (*other);
 }
 
@@ -429,6 +445,9 @@
 hb_set_symmetric_difference (hb_set_t       *set,
 			     const hb_set_t *other)
 {
+  if (unlikely (hb_object_is_immutable (set)))
+    return;
+
   set->symmetric_difference (*other);
 }
 
@@ -443,6 +462,9 @@
 void
 hb_set_invert (hb_set_t *set)
 {
+  if (unlikely (hb_object_is_immutable (set)))
+    return;
+
   set->invert ();
 }