Revert "[sanitize/Coverage] Keep a map of sane coverages"

This reverts commit a689114898cc3e8f1c6ba7cc49cd6c3639d91250.
pull/4337/head
Behdad Esfahbod 1 year ago
parent 0ab906715e
commit 837885f0fa
  1. 22
      src/OT/Layout/Common/Coverage.hh
  2. 3
      src/hb-sanitize.hh

@ -62,30 +62,18 @@ struct Coverage
#endif
bool sanitize (hb_sanitize_context_t *c) const
{
uintptr_t offset = (uintptr_t) this - (uintptr_t) c->start;
if (offset < HB_SET_VALUE_INVALID &&
c->sane_coverages.has ((hb_codepoint_t) offset))
return true;
bool ret;
TRACE_SANITIZE (this);
if (!u.format.sanitize (c)) return_trace (false);
switch (u.format)
{
case 1: ret = u.format1.sanitize (c); break;
case 2: ret = u.format2.sanitize (c); break;
case 1: return_trace (u.format1.sanitize (c));
case 2: return_trace (u.format2.sanitize (c));
#ifndef HB_NO_BEYOND_64K
case 3: ret = u.format3.sanitize (c); break;
case 4: ret = u.format4.sanitize (c); break;
case 3: return_trace (u.format3.sanitize (c));
case 4: return_trace (u.format4.sanitize (c));
#endif
default:ret = true; break;
default:return_trace (true);
}
if (likely (offset < HB_SET_VALUE_INVALID && ret))
c->sane_coverages.set ((hb_codepoint_t) offset, 1);
return_trace (ret);
}
/* Has interface. */

@ -32,7 +32,6 @@
#include "hb.hh"
#include "hb-blob.hh"
#include "hb-dispatch.hh"
#include "hb-map.hh"
/*
@ -229,7 +228,6 @@ struct hb_sanitize_context_t :
this->edit_count = 0;
this->debug_depth = 0;
this->recursion_depth = 0;
this->sane_coverages.clear ();
DEBUG_MSG_LEVEL (SANITIZE, start, 0, +1,
"start [%p..%p] (%lu bytes)",
@ -507,7 +505,6 @@ struct hb_sanitize_context_t :
bool num_glyphs_set;
public:
bool lazy_some_gpos;
hb_map_t sane_coverages;
};
struct hb_sanitize_with_object_t

Loading…
Cancel
Save