Start cleaning up get_size()
So we know when the size is static and when dynamic.
This commit is contained in:
parent
b157617644
commit
e45d3f86f9
|
@ -47,20 +47,19 @@ struct TTCHeader;
|
||||||
|
|
||||||
typedef struct TableDirectory
|
typedef struct TableDirectory
|
||||||
{
|
{
|
||||||
static inline unsigned int get_size () { return sizeof (TableDirectory); }
|
|
||||||
|
|
||||||
inline bool sanitize (hb_sanitize_context_t *context) {
|
inline bool sanitize (hb_sanitize_context_t *context) {
|
||||||
TRACE_SANITIZE ();
|
TRACE_SANITIZE ();
|
||||||
return context->check_struct (this);
|
return context->check_struct (this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DEFINE_SIZE_STATIC (16);
|
||||||
|
|
||||||
Tag tag; /* 4-byte identifier. */
|
Tag tag; /* 4-byte identifier. */
|
||||||
CheckSum checkSum; /* CheckSum for this table. */
|
CheckSum checkSum; /* CheckSum for this table. */
|
||||||
ULONG offset; /* Offset from beginning of TrueType font
|
ULONG offset; /* Offset from beginning of TrueType font
|
||||||
* file. */
|
* file. */
|
||||||
ULONG length; /* Length of this table. */
|
ULONG length; /* Length of this table. */
|
||||||
} OpenTypeTable;
|
} OpenTypeTable;
|
||||||
ASSERT_SIZE (TableDirectory, 16);
|
|
||||||
|
|
||||||
typedef struct OffsetTable
|
typedef struct OffsetTable
|
||||||
{
|
{
|
||||||
|
@ -101,7 +100,7 @@ typedef struct OffsetTable
|
||||||
inline bool sanitize (hb_sanitize_context_t *context) {
|
inline bool sanitize (hb_sanitize_context_t *context) {
|
||||||
TRACE_SANITIZE ();
|
TRACE_SANITIZE ();
|
||||||
return context->check_struct (this)
|
return context->check_struct (this)
|
||||||
&& context->check_array (tableDir, TableDirectory::get_size (), numTables);
|
&& context->check_array (tableDir, TableDirectory::static_size, numTables);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -85,6 +85,29 @@ inline Type& StructAfter(TObject &X)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Size checking
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define DEFINE_SIZE_STATIC(size) \
|
||||||
|
inline void _size_assertion (void) const \
|
||||||
|
{ ASSERT_STATIC (sizeof (*this) == (size)); } \
|
||||||
|
static inline unsigned int get_size (void) { return (size); } \
|
||||||
|
static const unsigned int static_size = (size); \
|
||||||
|
static const unsigned int min_size = (size)
|
||||||
|
|
||||||
|
#define DEFINE_SIZE_VAR(size, _var_type) \
|
||||||
|
inline void _size_assertion (void) const \
|
||||||
|
{ ASSERT_STATIC (sizeof (*this) == (size) + VAR0 * sizeof (_var_type)); } \
|
||||||
|
static const unsigned int min_size = (size)
|
||||||
|
|
||||||
|
#define DEFINE_SIZE_VAR2(_type, size, _var_type1, _var_type2) \
|
||||||
|
inline void _size_assertion (void) const \
|
||||||
|
{ ASSERT_STATIC (sizeof (*this) == (size) + VAR0 * sizeof (_var_type1) + VAR0 * sizeof (_var_type2)); } \
|
||||||
|
static const unsigned int min_size = (size)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Null objects
|
* Null objects
|
||||||
*/
|
*/
|
||||||
|
@ -348,7 +371,6 @@ class BEInt<Type, 4>
|
||||||
template <typename Type>
|
template <typename Type>
|
||||||
struct IntType
|
struct IntType
|
||||||
{
|
{
|
||||||
static inline unsigned int get_size () { return sizeof (Type); }
|
|
||||||
inline void set (Type i) { v = i; }
|
inline void set (Type i) { v = i; }
|
||||||
inline operator Type(void) const { return v; }
|
inline operator Type(void) const { return v; }
|
||||||
inline bool operator == (const IntType<Type> &o) const { return v == o.v; }
|
inline bool operator == (const IntType<Type> &o) const { return v == o.v; }
|
||||||
|
@ -357,6 +379,7 @@ struct IntType
|
||||||
TRACE_SANITIZE ();
|
TRACE_SANITIZE ();
|
||||||
return context->check_struct (this);
|
return context->check_struct (this);
|
||||||
}
|
}
|
||||||
|
DEFINE_SIZE_STATIC (sizeof (Type));
|
||||||
private: BEInt<Type, sizeof (Type)> v;
|
private: BEInt<Type, sizeof (Type)> v;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -365,11 +388,6 @@ typedef IntType<int16_t> SHORT; /* 16-bit signed integer. */
|
||||||
typedef IntType<uint32_t> ULONG; /* 32-bit unsigned integer. */
|
typedef IntType<uint32_t> ULONG; /* 32-bit unsigned integer. */
|
||||||
typedef IntType<int32_t> LONG; /* 32-bit signed integer. */
|
typedef IntType<int32_t> LONG; /* 32-bit signed integer. */
|
||||||
|
|
||||||
ASSERT_SIZE (USHORT, 2);
|
|
||||||
ASSERT_SIZE (SHORT, 2);
|
|
||||||
ASSERT_SIZE (ULONG, 4);
|
|
||||||
ASSERT_SIZE (LONG, 4);
|
|
||||||
|
|
||||||
/* Array of four uint8s (length = 32 bits) used to identify a script, language
|
/* Array of four uint8s (length = 32 bits) used to identify a script, language
|
||||||
* system, feature, or baseline */
|
* system, feature, or baseline */
|
||||||
struct Tag : ULONG
|
struct Tag : ULONG
|
||||||
|
@ -397,7 +415,7 @@ struct CheckSum : ULONG
|
||||||
static uint32_t CalcTableChecksum (ULONG *Table, uint32_t Length)
|
static uint32_t CalcTableChecksum (ULONG *Table, uint32_t Length)
|
||||||
{
|
{
|
||||||
uint32_t Sum = 0L;
|
uint32_t Sum = 0L;
|
||||||
ULONG *EndPtr = Table+((Length+3) & ~3) / ULONG::get_size ();
|
ULONG *EndPtr = Table+((Length+3) & ~3) / ULONG::static_size;
|
||||||
|
|
||||||
while (Table < EndPtr)
|
while (Table < EndPtr)
|
||||||
Sum += *Table++;
|
Sum += *Table++;
|
||||||
|
@ -463,7 +481,7 @@ struct GenericOffsetTo : OffsetType
|
||||||
private:
|
private:
|
||||||
/* Set the offset to Null */
|
/* Set the offset to Null */
|
||||||
inline bool neuter (hb_sanitize_context_t *context) {
|
inline bool neuter (hb_sanitize_context_t *context) {
|
||||||
if (context->can_edit (CharP(this), this->get_size ())) {
|
if (context->can_edit (CharP(this), this->static_size)) {
|
||||||
this->set (0); /* 0 is Null offset */
|
this->set (0); /* 0 is Null offset */
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -508,7 +526,7 @@ struct GenericArrayOf
|
||||||
return array()[i];
|
return array()[i];
|
||||||
}
|
}
|
||||||
inline unsigned int get_size () const
|
inline unsigned int get_size () const
|
||||||
{ return len.get_size () + len * Type::get_size (); }
|
{ return len.static_size + len * Type::static_size; }
|
||||||
|
|
||||||
inline bool sanitize (hb_sanitize_context_t *context) {
|
inline bool sanitize (hb_sanitize_context_t *context) {
|
||||||
TRACE_SANITIZE ();
|
TRACE_SANITIZE ();
|
||||||
|
@ -551,7 +569,7 @@ struct GenericArrayOf
|
||||||
inline bool sanitize_shallow (hb_sanitize_context_t *context) {
|
inline bool sanitize_shallow (hb_sanitize_context_t *context) {
|
||||||
TRACE_SANITIZE ();
|
TRACE_SANITIZE ();
|
||||||
return context->check_struct (this)
|
return context->check_struct (this)
|
||||||
&& context->check_array (this, Type::get_size (), len);
|
&& context->check_array (this, Type::static_size, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -615,11 +633,11 @@ struct HeadlessArrayOf
|
||||||
return array()[i-1];
|
return array()[i-1];
|
||||||
}
|
}
|
||||||
inline unsigned int get_size () const
|
inline unsigned int get_size () const
|
||||||
{ return len.get_size () + (len ? len - 1 : 0) * Type::get_size (); }
|
{ return len.static_size + (len ? len - 1 : 0) * Type::static_size; }
|
||||||
|
|
||||||
inline bool sanitize_shallow (hb_sanitize_context_t *context) {
|
inline bool sanitize_shallow (hb_sanitize_context_t *context) {
|
||||||
return context->check_struct (this)
|
return context->check_struct (this)
|
||||||
&& context->check_array (this, Type::get_size (), len);
|
&& context->check_array (this, Type::static_size, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool sanitize (hb_sanitize_context_t *context) {
|
inline bool sanitize (hb_sanitize_context_t *context) {
|
||||||
|
|
|
@ -51,14 +51,14 @@
|
||||||
template <typename Type>
|
template <typename Type>
|
||||||
struct Record
|
struct Record
|
||||||
{
|
{
|
||||||
static inline unsigned int get_size () { return sizeof (Record<Type>); }
|
|
||||||
|
|
||||||
inline bool sanitize (hb_sanitize_context_t *context, void *base) {
|
inline bool sanitize (hb_sanitize_context_t *context, void *base) {
|
||||||
TRACE_SANITIZE ();
|
TRACE_SANITIZE ();
|
||||||
return context->check_struct (this)
|
return context->check_struct (this)
|
||||||
&& offset.sanitize (context, base);
|
&& offset.sanitize (context, base);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DEFINE_SIZE_STATIC (6);
|
||||||
|
|
||||||
Tag tag; /* 4-byte Tag identifier */
|
Tag tag; /* 4-byte Tag identifier */
|
||||||
OffsetTo<Type>
|
OffsetTo<Type>
|
||||||
offset; /* Offset from beginning of object holding
|
offset; /* Offset from beginning of object holding
|
||||||
|
@ -350,8 +350,6 @@ struct CoverageRangeRecord
|
||||||
{
|
{
|
||||||
friend struct CoverageFormat2;
|
friend struct CoverageFormat2;
|
||||||
|
|
||||||
static inline unsigned int get_size () { return sizeof (CoverageRangeRecord); }
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
inline unsigned int get_coverage (hb_codepoint_t glyph_id) const
|
inline unsigned int get_coverage (hb_codepoint_t glyph_id) const
|
||||||
{
|
{
|
||||||
|
@ -366,13 +364,14 @@ struct CoverageRangeRecord
|
||||||
return context->check_struct (this);
|
return context->check_struct (this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DEFINE_SIZE_STATIC (6);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
GlyphID start; /* First GlyphID in the range */
|
GlyphID start; /* First GlyphID in the range */
|
||||||
GlyphID end; /* Last GlyphID in the range */
|
GlyphID end; /* Last GlyphID in the range */
|
||||||
USHORT startCoverageIndex; /* Coverage Index of first GlyphID in
|
USHORT startCoverageIndex; /* Coverage Index of first GlyphID in
|
||||||
* range */
|
* range */
|
||||||
};
|
};
|
||||||
ASSERT_SIZE (CoverageRangeRecord, 6);
|
|
||||||
DEFINE_NULL_DATA (CoverageRangeRecord, 6, "\000\001");
|
DEFINE_NULL_DATA (CoverageRangeRecord, 6, "\000\001");
|
||||||
|
|
||||||
struct CoverageFormat2
|
struct CoverageFormat2
|
||||||
|
@ -472,8 +471,6 @@ struct ClassRangeRecord
|
||||||
{
|
{
|
||||||
friend struct ClassDefFormat2;
|
friend struct ClassDefFormat2;
|
||||||
|
|
||||||
static inline unsigned int get_size () { return sizeof (ClassRangeRecord); }
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
inline hb_ot_layout_class_t get_class (hb_codepoint_t glyph_id) const
|
inline hb_ot_layout_class_t get_class (hb_codepoint_t glyph_id) const
|
||||||
{
|
{
|
||||||
|
@ -488,12 +485,13 @@ struct ClassRangeRecord
|
||||||
return context->check_struct (this);
|
return context->check_struct (this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DEFINE_SIZE_STATIC (6);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
GlyphID start; /* First GlyphID in the range */
|
GlyphID start; /* First GlyphID in the range */
|
||||||
GlyphID end; /* Last GlyphID in the range */
|
GlyphID end; /* Last GlyphID in the range */
|
||||||
USHORT classValue; /* Applied to all glyphs in the range */
|
USHORT classValue; /* Applied to all glyphs in the range */
|
||||||
};
|
};
|
||||||
ASSERT_SIZE (ClassRangeRecord, 6);
|
|
||||||
DEFINE_NULL_DATA (ClassRangeRecord, 6, "\000\001");
|
DEFINE_NULL_DATA (ClassRangeRecord, 6, "\000\001");
|
||||||
|
|
||||||
struct ClassDefFormat2
|
struct ClassDefFormat2
|
||||||
|
|
|
@ -90,7 +90,7 @@ struct ValueFormat : USHORT
|
||||||
inline unsigned int get_len () const
|
inline unsigned int get_len () const
|
||||||
{ return _hb_popcount32 ((unsigned int) *this); }
|
{ return _hb_popcount32 ((unsigned int) *this); }
|
||||||
inline unsigned int get_size () const
|
inline unsigned int get_size () const
|
||||||
{ return get_len () * Value::get_size (); }
|
{ return get_len () * Value::static_size; }
|
||||||
|
|
||||||
void apply_value (hb_ot_layout_context_t *layout,
|
void apply_value (hb_ot_layout_context_t *layout,
|
||||||
const char *base,
|
const char *base,
|
||||||
|
@ -349,7 +349,7 @@ struct AnchorMatrix
|
||||||
if (!context->check_struct (this)) return false;
|
if (!context->check_struct (this)) return false;
|
||||||
if (unlikely (cols >= ((unsigned int) -1) / rows)) return false;
|
if (unlikely (cols >= ((unsigned int) -1) / rows)) return false;
|
||||||
unsigned int count = rows * cols;
|
unsigned int count = rows * cols;
|
||||||
if (!context->check_array (matrix, matrix[0].get_size (), count)) return false;
|
if (!context->check_array (matrix, matrix[0].static_size, count)) return false;
|
||||||
for (unsigned int i = 0; i < count; i++)
|
for (unsigned int i = 0; i < count; i++)
|
||||||
if (!matrix[i].sanitize (context, this)) return false;
|
if (!matrix[i].sanitize (context, this)) return false;
|
||||||
return true;
|
return true;
|
||||||
|
@ -368,21 +368,19 @@ struct MarkRecord
|
||||||
{
|
{
|
||||||
friend struct MarkArray;
|
friend struct MarkArray;
|
||||||
|
|
||||||
static inline unsigned int get_size () { return sizeof (MarkRecord); }
|
|
||||||
|
|
||||||
inline bool sanitize (hb_sanitize_context_t *context, void *base) {
|
inline bool sanitize (hb_sanitize_context_t *context, void *base) {
|
||||||
TRACE_SANITIZE ();
|
TRACE_SANITIZE ();
|
||||||
return context->check_struct (this)
|
return context->check_struct (this)
|
||||||
&& markAnchor.sanitize (context, base);
|
&& markAnchor.sanitize (context, base);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DEFINE_SIZE_STATIC (4);
|
||||||
private:
|
private:
|
||||||
USHORT klass; /* Class defined for this mark */
|
USHORT klass; /* Class defined for this mark */
|
||||||
OffsetTo<Anchor>
|
OffsetTo<Anchor>
|
||||||
markAnchor; /* Offset to Anchor table--from
|
markAnchor; /* Offset to Anchor table--from
|
||||||
* beginning of MarkArray table */
|
* beginning of MarkArray table */
|
||||||
};
|
};
|
||||||
ASSERT_SIZE (MarkRecord, 4);
|
|
||||||
|
|
||||||
struct MarkArray
|
struct MarkArray
|
||||||
{
|
{
|
||||||
|
@ -565,7 +563,7 @@ struct PairSet
|
||||||
TRACE_SANITIZE ();
|
TRACE_SANITIZE ();
|
||||||
if (!context->check_struct (this)) return false;
|
if (!context->check_struct (this)) return false;
|
||||||
unsigned int count = (1 + format_len) * len;
|
unsigned int count = (1 + format_len) * len;
|
||||||
return context->check_array (array, USHORT::get_size (), count);
|
return context->check_array (array, USHORT::static_size, count);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -602,7 +600,7 @@ struct PairPosFormat1
|
||||||
|
|
||||||
unsigned int len1 = valueFormat1.get_len ();
|
unsigned int len1 = valueFormat1.get_len ();
|
||||||
unsigned int len2 = valueFormat2.get_len ();
|
unsigned int len2 = valueFormat2.get_len ();
|
||||||
unsigned int record_size = USHORT::get_size () * (1 + len1 + len2);
|
unsigned int record_size = USHORT::static_size * (1 + len1 + len2);
|
||||||
|
|
||||||
const PairSet &pair_set = this+pairSet[index];
|
const PairSet &pair_set = this+pairSet[index];
|
||||||
unsigned int count = pair_set.len;
|
unsigned int count = pair_set.len;
|
||||||
|
@ -795,14 +793,14 @@ struct PairPos
|
||||||
|
|
||||||
struct EntryExitRecord
|
struct EntryExitRecord
|
||||||
{
|
{
|
||||||
static inline unsigned int get_size () { return sizeof (EntryExitRecord); }
|
|
||||||
|
|
||||||
inline bool sanitize (hb_sanitize_context_t *context, void *base) {
|
inline bool sanitize (hb_sanitize_context_t *context, void *base) {
|
||||||
TRACE_SANITIZE ();
|
TRACE_SANITIZE ();
|
||||||
return entryAnchor.sanitize (context, base)
|
return entryAnchor.sanitize (context, base)
|
||||||
&& exitAnchor.sanitize (context, base);
|
&& exitAnchor.sanitize (context, base);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DEFINE_SIZE_STATIC (4);
|
||||||
|
|
||||||
OffsetTo<Anchor>
|
OffsetTo<Anchor>
|
||||||
entryAnchor; /* Offset to EntryAnchor table--from
|
entryAnchor; /* Offset to EntryAnchor table--from
|
||||||
* beginning of CursivePos
|
* beginning of CursivePos
|
||||||
|
@ -812,7 +810,6 @@ struct EntryExitRecord
|
||||||
* beginning of CursivePos
|
* beginning of CursivePos
|
||||||
* subtable--may be NULL */
|
* subtable--may be NULL */
|
||||||
};
|
};
|
||||||
ASSERT_SIZE (EntryExitRecord, 4);
|
|
||||||
|
|
||||||
struct CursivePosFormat1
|
struct CursivePosFormat1
|
||||||
{
|
{
|
||||||
|
|
|
@ -172,19 +172,18 @@ static inline bool match_lookahead (hb_apply_context_t *context,
|
||||||
|
|
||||||
struct LookupRecord
|
struct LookupRecord
|
||||||
{
|
{
|
||||||
static inline unsigned int get_size () { return sizeof (LookupRecord); }
|
|
||||||
|
|
||||||
inline bool sanitize (hb_sanitize_context_t *context) {
|
inline bool sanitize (hb_sanitize_context_t *context) {
|
||||||
TRACE_SANITIZE ();
|
TRACE_SANITIZE ();
|
||||||
return context->check_struct (this);
|
return context->check_struct (this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DEFINE_SIZE_STATIC (4);
|
||||||
|
|
||||||
USHORT sequenceIndex; /* Index into current glyph
|
USHORT sequenceIndex; /* Index into current glyph
|
||||||
* sequence--first glyph = 0 */
|
* sequence--first glyph = 0 */
|
||||||
USHORT lookupListIndex; /* Lookup to apply to that
|
USHORT lookupListIndex; /* Lookup to apply to that
|
||||||
* position--zero--based */
|
* position--zero--based */
|
||||||
};
|
};
|
||||||
ASSERT_SIZE (LookupRecord, 4);
|
|
||||||
|
|
||||||
static inline bool apply_lookup (hb_apply_context_t *context,
|
static inline bool apply_lookup (hb_apply_context_t *context,
|
||||||
unsigned int count, /* Including the first glyph */
|
unsigned int count, /* Including the first glyph */
|
||||||
|
@ -277,7 +276,7 @@ struct Rule
|
||||||
inline bool apply (hb_apply_context_t *context, ContextLookupContext &lookup_context) const
|
inline bool apply (hb_apply_context_t *context, ContextLookupContext &lookup_context) const
|
||||||
{
|
{
|
||||||
TRACE_APPLY ();
|
TRACE_APPLY ();
|
||||||
const LookupRecord *lookupRecord = &StructAtOffset<LookupRecord> (input, input[0].get_size () * (inputCount ? inputCount - 1 : 0));
|
const LookupRecord *lookupRecord = &StructAtOffset<LookupRecord> (input, input[0].static_size * (inputCount ? inputCount - 1 : 0));
|
||||||
return context_lookup (context,
|
return context_lookup (context,
|
||||||
inputCount, input,
|
inputCount, input,
|
||||||
lookupCount, lookupRecord,
|
lookupCount, lookupRecord,
|
||||||
|
@ -290,8 +289,8 @@ struct Rule
|
||||||
return inputCount.sanitize (context)
|
return inputCount.sanitize (context)
|
||||||
&& lookupCount.sanitize (context)
|
&& lookupCount.sanitize (context)
|
||||||
&& context->check_range (input,
|
&& context->check_range (input,
|
||||||
input[0].get_size () * inputCount
|
input[0].static_size * inputCount
|
||||||
+ lookupRecordX[0].get_size () * lookupCount);
|
+ lookupRecordX[0].static_size * lookupCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -430,7 +429,7 @@ struct ContextFormat3
|
||||||
if (likely (index == NOT_COVERED))
|
if (likely (index == NOT_COVERED))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
const LookupRecord *lookupRecord = &StructAtOffset<LookupRecord> (coverage, coverage[0].get_size () * glyphCount);
|
const LookupRecord *lookupRecord = &StructAtOffset<LookupRecord> (coverage, coverage[0].static_size * glyphCount);
|
||||||
struct ContextLookupContext lookup_context = {
|
struct ContextLookupContext lookup_context = {
|
||||||
{match_coverage, apply_func},
|
{match_coverage, apply_func},
|
||||||
CharP(this)
|
CharP(this)
|
||||||
|
@ -445,11 +444,11 @@ struct ContextFormat3
|
||||||
TRACE_SANITIZE ();
|
TRACE_SANITIZE ();
|
||||||
if (!context->check_struct (this)) return false;
|
if (!context->check_struct (this)) return false;
|
||||||
unsigned int count = glyphCount;
|
unsigned int count = glyphCount;
|
||||||
if (!context->check_array (coverage, OffsetTo<Coverage>::get_size (), count)) return false;
|
if (!context->check_array (coverage, coverage[0].static_size, count)) return false;
|
||||||
for (unsigned int i = 0; i < count; i++)
|
for (unsigned int i = 0; i < count; i++)
|
||||||
if (!coverage[i].sanitize (context, this)) return false;
|
if (!coverage[i].sanitize (context, this)) return false;
|
||||||
LookupRecord *lookupRecord = &StructAtOffset<LookupRecord> (coverage, OffsetTo<Coverage>::get_size () * count);
|
LookupRecord *lookupRecord = &StructAtOffset<LookupRecord> (coverage, coverage[0].static_size * count);
|
||||||
return context->check_array (lookupRecord, LookupRecord::get_size (), lookupCount);
|
return context->check_array (lookupRecord, lookupRecord[0].static_size, lookupCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Reference in New Issue