[array] Return Crap instead of Null if Type is not const
authorBehdad Esfahbod <behdad@behdad.org>
Mon, 17 Dec 2018 05:09:06 +0000 (00:09 -0500)
committerBehdad Esfahbod <behdad@behdad.org>
Mon, 17 Dec 2018 05:09:06 +0000 (00:09 -0500)
Ouch!

src/hb-array.hh

index 523e4ce..ae8d2d7 100644 (file)
@@ -55,7 +55,7 @@ struct hb_array_t
   Type& operator [] (int i_) const
   {
     unsigned int i = (unsigned int) i_;
-    if (unlikely (i >= len)) return Null(Type);
+    if (unlikely (i >= len)) return CrapOrNull(Type);
     return arrayZ[i];
   }