Remove SANITIZE_MEM

This commit is contained in:
Behdad Esfahbod 2010-05-06 10:26:52 -04:00
parent 4ad2cc5dec
commit f5fab0c718
4 changed files with 6 additions and 8 deletions

View File

@ -242,9 +242,7 @@ struct hb_sanitize_context_t
#define SANITIZE_WITH_BASE(B,X) likely ((X).sanitize (context, CharP(B)))
#define SANITIZE_SELF() SANITIZE_MEM(this, sizeof (*this))
#define SANITIZE_MEM(B,L) likely (context->check_range (CharP(B), (L)))
#define SANITIZE_SELF() likely(context->check_range (this, sizeof (*this)))
/* Template to sanitize an object. */

View File

@ -599,7 +599,7 @@ struct Device
inline bool sanitize (hb_sanitize_context_t *context) {
TRACE_SANITIZE ();
return SANITIZE_SELF()
&& SANITIZE_MEM (this, this->get_size ());
&& context->check_range (this, this->get_size ());
}
private:

View File

@ -159,7 +159,7 @@ struct ValueFormat : USHORT
inline bool sanitize_value (hb_sanitize_context_t *context, void *base, const Value *values) {
TRACE_SANITIZE ();
return SANITIZE_MEM (values, get_size ())
return context->check_range (values, get_size ())
&& (!has_device () || sanitize_value_devices (context, base, values));
}

View File

@ -289,9 +289,9 @@ struct Rule
TRACE_SANITIZE ();
return SANITIZE (inputCount)
&& SANITIZE (lookupCount)
&& SANITIZE_MEM (input,
input[0].get_size () * inputCount +
lookupRecordX[0].get_size () * lookupCount);
&& context->check_range (input,
input[0].get_size () * inputCount
+ lookupRecordX[0].get_size () * lookupCount);
}
private: