Remove SANITIZE_THIS
This commit is contained in:
parent
2226fc93d1
commit
bb029af943
|
@ -126,7 +126,7 @@ struct TTCHeaderVersion1
|
||||||
|
|
||||||
inline bool sanitize (SANITIZE_ARG_DEF) {
|
inline bool sanitize (SANITIZE_ARG_DEF) {
|
||||||
TRACE_SANITIZE ();
|
TRACE_SANITIZE ();
|
||||||
return SANITIZE_THIS (table);
|
return SANITIZE_WITH_BASE (this, table);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -229,8 +229,7 @@ _hb_sanitize_edit (SANITIZE_ARG_DEF,
|
||||||
|
|
||||||
#define SANITIZE(X) likely ((X).sanitize (SANITIZE_ARG))
|
#define SANITIZE(X) likely ((X).sanitize (SANITIZE_ARG))
|
||||||
|
|
||||||
#define SANITIZE_THIS(X) likely ((X).sanitize (SANITIZE_ARG, CharP(this)))
|
#define SANITIZE_WITH_BASE(B,X) likely ((X).sanitize (SANITIZE_ARG, CharP(B)))
|
||||||
#define SANITIZE_WITH_BASE(B,X) likely ((X).sanitize (SANITIZE_ARG, (B)))
|
|
||||||
|
|
||||||
#define SANITIZE_SELF() SANITIZE_MEM(this, sizeof (*this))
|
#define SANITIZE_SELF() SANITIZE_MEM(this, sizeof (*this))
|
||||||
|
|
||||||
|
|
|
@ -203,8 +203,8 @@ struct Script
|
||||||
|
|
||||||
inline bool sanitize (SANITIZE_ARG_DEF) {
|
inline bool sanitize (SANITIZE_ARG_DEF) {
|
||||||
TRACE_SANITIZE ();
|
TRACE_SANITIZE ();
|
||||||
return SANITIZE_THIS (defaultLangSys)
|
return SANITIZE_WITH_BASE (this, defaultLangSys)
|
||||||
&& SANITIZE_THIS (langSys);
|
&& SANITIZE_WITH_BASE (this, langSys);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -69,8 +69,8 @@ struct AttachList
|
||||||
|
|
||||||
inline bool sanitize (SANITIZE_ARG_DEF) {
|
inline bool sanitize (SANITIZE_ARG_DEF) {
|
||||||
TRACE_SANITIZE ();
|
TRACE_SANITIZE ();
|
||||||
return SANITIZE_THIS (coverage)
|
return SANITIZE_WITH_BASE (this, coverage)
|
||||||
&& SANITIZE_THIS (attachPoint);
|
&& SANITIZE_WITH_BASE (this, attachPoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -148,7 +148,8 @@ struct CaretValueFormat3
|
||||||
|
|
||||||
inline bool sanitize (SANITIZE_ARG_DEF) {
|
inline bool sanitize (SANITIZE_ARG_DEF) {
|
||||||
TRACE_SANITIZE ();
|
TRACE_SANITIZE ();
|
||||||
return SANITIZE_SELF () && SANITIZE_THIS (deviceTable);
|
return SANITIZE_SELF ()
|
||||||
|
&& SANITIZE_WITH_BASE (this, deviceTable);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -213,7 +214,7 @@ struct LigGlyph
|
||||||
|
|
||||||
inline bool sanitize (SANITIZE_ARG_DEF) {
|
inline bool sanitize (SANITIZE_ARG_DEF) {
|
||||||
TRACE_SANITIZE ();
|
TRACE_SANITIZE ();
|
||||||
return SANITIZE_THIS (carets);
|
return SANITIZE_WITH_BASE (this, carets);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -245,8 +246,8 @@ struct LigCaretList
|
||||||
|
|
||||||
inline bool sanitize (SANITIZE_ARG_DEF) {
|
inline bool sanitize (SANITIZE_ARG_DEF) {
|
||||||
TRACE_SANITIZE ();
|
TRACE_SANITIZE ();
|
||||||
return SANITIZE_THIS (coverage)
|
return SANITIZE_WITH_BASE (this, coverage)
|
||||||
&& SANITIZE_THIS (ligGlyph);
|
&& SANITIZE_WITH_BASE (this, ligGlyph);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -267,7 +268,7 @@ struct MarkGlyphSetsFormat1
|
||||||
|
|
||||||
inline bool sanitize (SANITIZE_ARG_DEF) {
|
inline bool sanitize (SANITIZE_ARG_DEF) {
|
||||||
TRACE_SANITIZE ();
|
TRACE_SANITIZE ();
|
||||||
return SANITIZE_THIS (coverage);
|
return SANITIZE_WITH_BASE (this, coverage);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -350,10 +351,12 @@ struct GDEF
|
||||||
|
|
||||||
inline bool sanitize (SANITIZE_ARG_DEF) {
|
inline bool sanitize (SANITIZE_ARG_DEF) {
|
||||||
TRACE_SANITIZE ();
|
TRACE_SANITIZE ();
|
||||||
return SANITIZE (version) && likely (version.major == 1) &&
|
return SANITIZE (version) && likely (version.major == 1)
|
||||||
SANITIZE_THIS (glyphClassDef) && SANITIZE_THIS (attachList) &&
|
&& SANITIZE_WITH_BASE (this, glyphClassDef)
|
||||||
SANITIZE_THIS (ligCaretList) && SANITIZE_THIS (markAttachClassDef) &&
|
&& SANITIZE_WITH_BASE (this, attachList)
|
||||||
(version < 0x00010002 || SANITIZE_THIS (markGlyphSetsDef[0]));
|
&& SANITIZE_WITH_BASE (this, ligCaretList)
|
||||||
|
&& SANITIZE_WITH_BASE (this, markAttachClassDef)
|
||||||
|
&& (version < 0x00010002 || SANITIZE_WITH_BASE (this, markGlyphSetsDef[0]));
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -271,8 +271,8 @@ struct AnchorFormat3
|
||||||
inline bool sanitize (SANITIZE_ARG_DEF) {
|
inline bool sanitize (SANITIZE_ARG_DEF) {
|
||||||
TRACE_SANITIZE ();
|
TRACE_SANITIZE ();
|
||||||
return SANITIZE_SELF ()
|
return SANITIZE_SELF ()
|
||||||
&& SANITIZE_THIS (xDeviceTable)
|
&& SANITIZE_WITH_BASE (this, xDeviceTable)
|
||||||
&& SANITIZE_THIS (yDeviceTable);
|
&& SANITIZE_WITH_BASE (this, yDeviceTable);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -339,7 +339,7 @@ struct AnchorMatrix
|
||||||
unsigned int count = rows * cols;
|
unsigned int count = rows * cols;
|
||||||
if (!SANITIZE_ARRAY (matrix, matrix[0].get_size (), count)) return false;
|
if (!SANITIZE_ARRAY (matrix, matrix[0].get_size (), count)) return false;
|
||||||
for (unsigned int i = 0; i < count; i++)
|
for (unsigned int i = 0; i < count; i++)
|
||||||
if (!SANITIZE_THIS (matrix[i])) return false;
|
if (!SANITIZE_WITH_BASE (this, matrix[i])) return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -404,7 +404,7 @@ struct MarkArray
|
||||||
|
|
||||||
inline bool sanitize (SANITIZE_ARG_DEF) {
|
inline bool sanitize (SANITIZE_ARG_DEF) {
|
||||||
TRACE_SANITIZE ();
|
TRACE_SANITIZE ();
|
||||||
return SANITIZE_THIS (markRecord);
|
return SANITIZE_WITH_BASE (this, markRecord);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -436,8 +436,9 @@ struct SinglePosFormat1
|
||||||
|
|
||||||
inline bool sanitize (SANITIZE_ARG_DEF) {
|
inline bool sanitize (SANITIZE_ARG_DEF) {
|
||||||
TRACE_SANITIZE ();
|
TRACE_SANITIZE ();
|
||||||
return SANITIZE_SELF () && SANITIZE_THIS (coverage) &&
|
return SANITIZE_SELF ()
|
||||||
valueFormat.sanitize_value (SANITIZE_ARG, CharP(this), values);
|
&& SANITIZE_WITH_BASE (this, coverage)
|
||||||
|
&& valueFormat.sanitize_value (SANITIZE_ARG, CharP(this), values);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -478,8 +479,9 @@ struct SinglePosFormat2
|
||||||
|
|
||||||
inline bool sanitize (SANITIZE_ARG_DEF) {
|
inline bool sanitize (SANITIZE_ARG_DEF) {
|
||||||
TRACE_SANITIZE ();
|
TRACE_SANITIZE ();
|
||||||
return SANITIZE_SELF () && SANITIZE_THIS (coverage) &&
|
return SANITIZE_SELF ()
|
||||||
valueFormat.sanitize_values (SANITIZE_ARG, CharP(this), values, valueCount);
|
&& SANITIZE_WITH_BASE (this, coverage)
|
||||||
|
&& valueFormat.sanitize_values (SANITIZE_ARG, CharP(this), values, valueCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -616,8 +618,9 @@ 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 ();
|
||||||
|
|
||||||
if (!(SANITIZE_SELF () && SANITIZE_THIS (coverage) &&
|
if (!(SANITIZE_SELF ()
|
||||||
likely (pairSet.sanitize (SANITIZE_ARG, CharP(this), len1 + len2)))) return false;
|
&& SANITIZE_WITH_BASE (this, coverage)
|
||||||
|
&& likely (pairSet.sanitize (SANITIZE_ARG, CharP(this), len1 + len2)))) return false;
|
||||||
|
|
||||||
if (!(valueFormat1.has_device () || valueFormat2.has_device ())) return true;
|
if (!(valueFormat1.has_device () || valueFormat2.has_device ())) return true;
|
||||||
|
|
||||||
|
@ -700,8 +703,10 @@ struct PairPosFormat2
|
||||||
|
|
||||||
inline bool sanitize (SANITIZE_ARG_DEF) {
|
inline bool sanitize (SANITIZE_ARG_DEF) {
|
||||||
TRACE_SANITIZE ();
|
TRACE_SANITIZE ();
|
||||||
if (!(SANITIZE_SELF () && SANITIZE_THIS (coverage) &&
|
if (!(SANITIZE_SELF ()
|
||||||
SANITIZE_THIS (classDef1) && SANITIZE_THIS (classDef2))) return false;
|
&& SANITIZE_WITH_BASE (this, coverage)
|
||||||
|
&& SANITIZE_WITH_BASE (this, classDef1)
|
||||||
|
&& SANITIZE_WITH_BASE (this, classDef2))) return false;
|
||||||
|
|
||||||
unsigned int len1 = valueFormat1.get_len ();
|
unsigned int len1 = valueFormat1.get_len ();
|
||||||
unsigned int len2 = valueFormat2.get_len ();
|
unsigned int len2 = valueFormat2.get_len ();
|
||||||
|
@ -979,8 +984,8 @@ struct CursivePosFormat1
|
||||||
|
|
||||||
inline bool sanitize (SANITIZE_ARG_DEF) {
|
inline bool sanitize (SANITIZE_ARG_DEF) {
|
||||||
TRACE_SANITIZE ();
|
TRACE_SANITIZE ();
|
||||||
return SANITIZE_THIS (coverage)
|
return SANITIZE_WITH_BASE (this, coverage)
|
||||||
&& SANITIZE_THIS (entryExitRecord);
|
&& SANITIZE_WITH_BASE (this, entryExitRecord);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -1068,9 +1073,9 @@ struct MarkBasePosFormat1
|
||||||
inline bool sanitize (SANITIZE_ARG_DEF) {
|
inline bool sanitize (SANITIZE_ARG_DEF) {
|
||||||
TRACE_SANITIZE ();
|
TRACE_SANITIZE ();
|
||||||
return SANITIZE_SELF ()
|
return SANITIZE_SELF ()
|
||||||
&& SANITIZE_THIS (markCoverage)
|
&& SANITIZE_WITH_BASE (this, markCoverage)
|
||||||
&& SANITIZE_THIS (baseCoverage)
|
&& SANITIZE_WITH_BASE (this, baseCoverage)
|
||||||
&& SANITIZE_THIS (markArray)
|
&& SANITIZE_WITH_BASE (this, markArray)
|
||||||
&& likely (baseArray.sanitize (SANITIZE_ARG, CharP(this), classCount));
|
&& likely (baseArray.sanitize (SANITIZE_ARG, CharP(this), classCount));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1192,9 +1197,9 @@ struct MarkLigPosFormat1
|
||||||
inline bool sanitize (SANITIZE_ARG_DEF) {
|
inline bool sanitize (SANITIZE_ARG_DEF) {
|
||||||
TRACE_SANITIZE ();
|
TRACE_SANITIZE ();
|
||||||
return SANITIZE_SELF ()
|
return SANITIZE_SELF ()
|
||||||
&& SANITIZE_THIS (markCoverage)
|
&& SANITIZE_WITH_BASE (this, markCoverage)
|
||||||
&& SANITIZE_THIS (ligatureCoverage)
|
&& SANITIZE_WITH_BASE (this, ligatureCoverage)
|
||||||
&& SANITIZE_THIS (markArray)
|
&& SANITIZE_WITH_BASE (this, markArray)
|
||||||
&& likely (ligatureArray.sanitize (SANITIZE_ARG, CharP(this), classCount));
|
&& likely (ligatureArray.sanitize (SANITIZE_ARG, CharP(this), classCount));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1295,9 +1300,9 @@ struct MarkMarkPosFormat1
|
||||||
inline bool sanitize (SANITIZE_ARG_DEF) {
|
inline bool sanitize (SANITIZE_ARG_DEF) {
|
||||||
TRACE_SANITIZE ();
|
TRACE_SANITIZE ();
|
||||||
return SANITIZE_SELF ()
|
return SANITIZE_SELF ()
|
||||||
&& SANITIZE_THIS (mark1Coverage)
|
&& SANITIZE_WITH_BASE (this, mark1Coverage)
|
||||||
&& SANITIZE_THIS (mark2Coverage)
|
&& SANITIZE_WITH_BASE (this, mark2Coverage)
|
||||||
&& SANITIZE_THIS (mark1Array)
|
&& SANITIZE_WITH_BASE (this, mark1Array)
|
||||||
&& likely (mark2Array.sanitize (SANITIZE_ARG, CharP(this), classCount));
|
&& likely (mark2Array.sanitize (SANITIZE_ARG, CharP(this), classCount));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1535,7 +1540,7 @@ struct PosLookup : Lookup
|
||||||
TRACE_SANITIZE ();
|
TRACE_SANITIZE ();
|
||||||
if (unlikely (!Lookup::sanitize (SANITIZE_ARG))) return false;
|
if (unlikely (!Lookup::sanitize (SANITIZE_ARG))) return false;
|
||||||
OffsetArrayOf<PosLookupSubTable> &list = CastR<OffsetArrayOf<PosLookupSubTable> > (subTable);
|
OffsetArrayOf<PosLookupSubTable> &list = CastR<OffsetArrayOf<PosLookupSubTable> > (subTable);
|
||||||
return SANITIZE_THIS (list);
|
return SANITIZE_WITH_BASE (this, list);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1563,7 +1568,7 @@ struct GPOS : GSUBGPOS
|
||||||
TRACE_SANITIZE ();
|
TRACE_SANITIZE ();
|
||||||
if (unlikely (!GSUBGPOS::sanitize (SANITIZE_ARG))) return false;
|
if (unlikely (!GSUBGPOS::sanitize (SANITIZE_ARG))) return false;
|
||||||
OffsetTo<PosLookupList> &list = CastR<OffsetTo<PosLookupList> > (lookupList);
|
OffsetTo<PosLookupList> &list = CastR<OffsetTo<PosLookupList> > (lookupList);
|
||||||
return SANITIZE_THIS (list);
|
return SANITIZE_WITH_BASE (this, list);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
ASSERT_SIZE (GPOS, 10);
|
ASSERT_SIZE (GPOS, 10);
|
||||||
|
|
|
@ -56,7 +56,8 @@ struct SingleSubstFormat1
|
||||||
|
|
||||||
inline bool sanitize (SANITIZE_ARG_DEF) {
|
inline bool sanitize (SANITIZE_ARG_DEF) {
|
||||||
TRACE_SANITIZE ();
|
TRACE_SANITIZE ();
|
||||||
return SANITIZE_THIS (coverage) && SANITIZE (deltaGlyphID);
|
return SANITIZE_WITH_BASE (this, coverage)
|
||||||
|
&& SANITIZE (deltaGlyphID);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -98,7 +99,8 @@ struct SingleSubstFormat2
|
||||||
|
|
||||||
inline bool sanitize (SANITIZE_ARG_DEF) {
|
inline bool sanitize (SANITIZE_ARG_DEF) {
|
||||||
TRACE_SANITIZE ();
|
TRACE_SANITIZE ();
|
||||||
return SANITIZE_THIS (coverage) && SANITIZE (substitute);
|
return SANITIZE_WITH_BASE (this, coverage)
|
||||||
|
&& SANITIZE (substitute);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -208,8 +210,8 @@ struct MultipleSubstFormat1
|
||||||
|
|
||||||
inline bool sanitize (SANITIZE_ARG_DEF) {
|
inline bool sanitize (SANITIZE_ARG_DEF) {
|
||||||
TRACE_SANITIZE ();
|
TRACE_SANITIZE ();
|
||||||
return SANITIZE_THIS (coverage)
|
return SANITIZE_WITH_BASE (this, coverage)
|
||||||
&& SANITIZE_THIS (sequence);
|
&& SANITIZE_WITH_BASE (this, sequence);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -304,8 +306,8 @@ struct AlternateSubstFormat1
|
||||||
|
|
||||||
inline bool sanitize (SANITIZE_ARG_DEF) {
|
inline bool sanitize (SANITIZE_ARG_DEF) {
|
||||||
TRACE_SANITIZE ();
|
TRACE_SANITIZE ();
|
||||||
return SANITIZE_THIS (coverage)
|
return SANITIZE_WITH_BASE (this, coverage)
|
||||||
&& SANITIZE_THIS (alternateSet);
|
&& SANITIZE_WITH_BASE (this, alternateSet);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -456,7 +458,7 @@ struct LigatureSet
|
||||||
public:
|
public:
|
||||||
inline bool sanitize (SANITIZE_ARG_DEF) {
|
inline bool sanitize (SANITIZE_ARG_DEF) {
|
||||||
TRACE_SANITIZE ();
|
TRACE_SANITIZE ();
|
||||||
return SANITIZE_THIS (ligature);
|
return SANITIZE_WITH_BASE (this, ligature);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -488,8 +490,8 @@ struct LigatureSubstFormat1
|
||||||
|
|
||||||
inline bool sanitize (SANITIZE_ARG_DEF) {
|
inline bool sanitize (SANITIZE_ARG_DEF) {
|
||||||
TRACE_SANITIZE ();
|
TRACE_SANITIZE ();
|
||||||
return SANITIZE_THIS (coverage)
|
return SANITIZE_WITH_BASE (this, coverage)
|
||||||
&& SANITIZE_THIS (ligatureSet);
|
&& SANITIZE_WITH_BASE (this, ligatureSet);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -619,10 +621,11 @@ struct ReverseChainSingleSubstFormat1
|
||||||
|
|
||||||
inline bool sanitize (SANITIZE_ARG_DEF) {
|
inline bool sanitize (SANITIZE_ARG_DEF) {
|
||||||
TRACE_SANITIZE ();
|
TRACE_SANITIZE ();
|
||||||
if (!(SANITIZE_THIS (coverage) && SANITIZE_THIS (backtrack)))
|
if (!(SANITIZE_WITH_BASE (this, coverage)
|
||||||
|
&& SANITIZE_WITH_BASE (this, backtrack)))
|
||||||
return false;
|
return false;
|
||||||
OffsetArrayOf<Coverage> &lookahead = StructAfter<OffsetArrayOf<Coverage> > (backtrack);
|
OffsetArrayOf<Coverage> &lookahead = StructAfter<OffsetArrayOf<Coverage> > (backtrack);
|
||||||
if (!SANITIZE_THIS (lookahead))
|
if (!SANITIZE_WITH_BASE (this, lookahead))
|
||||||
return false;
|
return false;
|
||||||
ArrayOf<GlyphID> &substitute = StructAfter<ArrayOf<GlyphID> > (lookahead);
|
ArrayOf<GlyphID> &substitute = StructAfter<ArrayOf<GlyphID> > (lookahead);
|
||||||
return SANITIZE (substitute);
|
return SANITIZE (substitute);
|
||||||
|
@ -848,7 +851,7 @@ struct SubstLookup : Lookup
|
||||||
TRACE_SANITIZE ();
|
TRACE_SANITIZE ();
|
||||||
if (unlikely (!Lookup::sanitize (SANITIZE_ARG))) return false;
|
if (unlikely (!Lookup::sanitize (SANITIZE_ARG))) return false;
|
||||||
OffsetArrayOf<SubstLookupSubTable> &list = CastR<OffsetArrayOf<SubstLookupSubTable> > (subTable);
|
OffsetArrayOf<SubstLookupSubTable> &list = CastR<OffsetArrayOf<SubstLookupSubTable> > (subTable);
|
||||||
return SANITIZE_THIS (list);
|
return SANITIZE_WITH_BASE (this, list);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -877,7 +880,7 @@ struct GSUB : GSUBGPOS
|
||||||
TRACE_SANITIZE ();
|
TRACE_SANITIZE ();
|
||||||
if (unlikely (!GSUBGPOS::sanitize (SANITIZE_ARG))) return false;
|
if (unlikely (!GSUBGPOS::sanitize (SANITIZE_ARG))) return false;
|
||||||
OffsetTo<SubstLookupList> &list = CastR<OffsetTo<SubstLookupList> > (lookupList);
|
OffsetTo<SubstLookupList> &list = CastR<OffsetTo<SubstLookupList> > (lookupList);
|
||||||
return SANITIZE_THIS (list);
|
return SANITIZE_WITH_BASE (this, list);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
ASSERT_SIZE (GSUB, 10);
|
ASSERT_SIZE (GSUB, 10);
|
||||||
|
|
|
@ -326,7 +326,7 @@ struct RuleSet
|
||||||
|
|
||||||
inline bool sanitize (SANITIZE_ARG_DEF) {
|
inline bool sanitize (SANITIZE_ARG_DEF) {
|
||||||
TRACE_SANITIZE ();
|
TRACE_SANITIZE ();
|
||||||
return SANITIZE_THIS (rule);
|
return SANITIZE_WITH_BASE (this, rule);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -358,8 +358,8 @@ struct ContextFormat1
|
||||||
|
|
||||||
inline bool sanitize (SANITIZE_ARG_DEF) {
|
inline bool sanitize (SANITIZE_ARG_DEF) {
|
||||||
TRACE_SANITIZE ();
|
TRACE_SANITIZE ();
|
||||||
return SANITIZE_THIS (coverage)
|
return SANITIZE_WITH_BASE (this, coverage)
|
||||||
&& SANITIZE_THIS (ruleSet);
|
&& SANITIZE_WITH_BASE (this, ruleSet);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -401,9 +401,9 @@ struct ContextFormat2
|
||||||
|
|
||||||
inline bool sanitize (SANITIZE_ARG_DEF) {
|
inline bool sanitize (SANITIZE_ARG_DEF) {
|
||||||
TRACE_SANITIZE ();
|
TRACE_SANITIZE ();
|
||||||
return SANITIZE_THIS (coverage)
|
return SANITIZE_WITH_BASE (this, coverage)
|
||||||
&& SANITIZE_THIS (classDef)
|
&& SANITIZE_WITH_BASE (this, classDef)
|
||||||
&& SANITIZE_THIS (ruleSet);
|
&& SANITIZE_WITH_BASE (this, ruleSet);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -450,7 +450,7 @@ struct ContextFormat3
|
||||||
unsigned int count = glyphCount;
|
unsigned int count = glyphCount;
|
||||||
if (!SANITIZE_ARRAY (coverage, OffsetTo<Coverage>::get_size (), glyphCount)) return false;
|
if (!SANITIZE_ARRAY (coverage, OffsetTo<Coverage>::get_size (), glyphCount)) return false;
|
||||||
for (unsigned int i = 0; i < count; i++)
|
for (unsigned int i = 0; i < count; i++)
|
||||||
if (!SANITIZE_THIS (coverage[i])) return false;
|
if (!SANITIZE_WITH_BASE (this, coverage[i])) return false;
|
||||||
LookupRecord &lookupRecord = StructAtOffset<LookupRecord> (coverage, OffsetTo<Coverage>::get_size () * glyphCount);
|
LookupRecord &lookupRecord = StructAtOffset<LookupRecord> (coverage, OffsetTo<Coverage>::get_size () * glyphCount);
|
||||||
return SANITIZE_ARRAY (&lookupRecord, LookupRecord::get_size (), lookupCount);
|
return SANITIZE_ARRAY (&lookupRecord, LookupRecord::get_size (), lookupCount);
|
||||||
}
|
}
|
||||||
|
@ -613,7 +613,7 @@ struct ChainRuleSet
|
||||||
|
|
||||||
inline bool sanitize (SANITIZE_ARG_DEF) {
|
inline bool sanitize (SANITIZE_ARG_DEF) {
|
||||||
TRACE_SANITIZE ();
|
TRACE_SANITIZE ();
|
||||||
return SANITIZE_THIS (rule);
|
return SANITIZE_WITH_BASE (this, rule);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -645,8 +645,8 @@ struct ChainContextFormat1
|
||||||
|
|
||||||
inline bool sanitize (SANITIZE_ARG_DEF) {
|
inline bool sanitize (SANITIZE_ARG_DEF) {
|
||||||
TRACE_SANITIZE ();
|
TRACE_SANITIZE ();
|
||||||
return SANITIZE_THIS (coverage)
|
return SANITIZE_WITH_BASE (this, coverage)
|
||||||
&& SANITIZE_THIS (ruleSet);
|
&& SANITIZE_WITH_BASE (this, ruleSet);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -692,11 +692,11 @@ struct ChainContextFormat2
|
||||||
|
|
||||||
inline bool sanitize (SANITIZE_ARG_DEF) {
|
inline bool sanitize (SANITIZE_ARG_DEF) {
|
||||||
TRACE_SANITIZE ();
|
TRACE_SANITIZE ();
|
||||||
return SANITIZE_THIS (coverage)
|
return SANITIZE_WITH_BASE (this, coverage)
|
||||||
&& SANITIZE_THIS (backtrackClassDef)
|
&& SANITIZE_WITH_BASE (this, backtrackClassDef)
|
||||||
&& SANITIZE_THIS (inputClassDef)
|
&& SANITIZE_WITH_BASE (this, inputClassDef)
|
||||||
&& SANITIZE_THIS (lookaheadClassDef)
|
&& SANITIZE_WITH_BASE (this, lookaheadClassDef)
|
||||||
&& SANITIZE_THIS (ruleSet);
|
&& SANITIZE_WITH_BASE (this, ruleSet);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -754,11 +754,11 @@ struct ChainContextFormat3
|
||||||
|
|
||||||
inline bool sanitize (SANITIZE_ARG_DEF) {
|
inline bool sanitize (SANITIZE_ARG_DEF) {
|
||||||
TRACE_SANITIZE ();
|
TRACE_SANITIZE ();
|
||||||
if (!SANITIZE_THIS (backtrack)) return false;
|
if (!SANITIZE_WITH_BASE (this, backtrack)) return false;
|
||||||
OffsetArrayOf<Coverage> &input = StructAfter<OffsetArrayOf<Coverage> > (backtrack);
|
OffsetArrayOf<Coverage> &input = StructAfter<OffsetArrayOf<Coverage> > (backtrack);
|
||||||
if (!SANITIZE_THIS (input)) return false;
|
if (!SANITIZE_WITH_BASE (this, input)) return false;
|
||||||
OffsetArrayOf<Coverage> &lookahead = StructAfter<OffsetArrayOf<Coverage> > (input);
|
OffsetArrayOf<Coverage> &lookahead = StructAfter<OffsetArrayOf<Coverage> > (input);
|
||||||
if (!SANITIZE_THIS (lookahead)) return false;
|
if (!SANITIZE_WITH_BASE (this, lookahead)) return false;
|
||||||
ArrayOf<LookupRecord> &lookup = StructAfter<ArrayOf<LookupRecord> > (lookahead);
|
ArrayOf<LookupRecord> &lookup = StructAfter<ArrayOf<LookupRecord> > (lookahead);
|
||||||
return SANITIZE (lookup);
|
return SANITIZE (lookup);
|
||||||
}
|
}
|
||||||
|
@ -918,9 +918,9 @@ struct GSUBGPOS
|
||||||
inline bool sanitize (SANITIZE_ARG_DEF) {
|
inline bool sanitize (SANITIZE_ARG_DEF) {
|
||||||
TRACE_SANITIZE ();
|
TRACE_SANITIZE ();
|
||||||
return SANITIZE (version) && likely (version.major == 1)
|
return SANITIZE (version) && likely (version.major == 1)
|
||||||
&& SANITIZE_THIS (scriptList)
|
&& SANITIZE_WITH_BASE (this, scriptList)
|
||||||
&& SANITIZE_THIS (featureList)
|
&& SANITIZE_WITH_BASE (this, featureList)
|
||||||
&& SANITIZE_THIS (lookupList);
|
&& SANITIZE_WITH_BASE (this, lookupList);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
Loading…
Reference in New Issue