diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2009-08-04 14:10:39 -0400 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2009-08-04 14:10:39 -0400 |
commit | 7a0a97bc1b8ee09004140fdec8529d52f5702c18 (patch) | |
tree | 784f21d3af506c85818fc7283599545548d3f8ef | |
parent | b2eb172416f9ad32a60bb33a26df6bf40ae69453 (diff) | |
download | pango-7a0a97bc1b8ee09004140fdec8529d52f5702c18.tar.gz |
[HB] Hookup NEUTER()
-rw-r--r-- | pango/opentype/hb-open-types-private.hh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pango/opentype/hb-open-types-private.hh b/pango/opentype/hb-open-types-private.hh index 6129bfc8..8e325d73 100644 --- a/pango/opentype/hb-open-types-private.hh +++ b/pango/opentype/hb-open-types-private.hh @@ -83,7 +83,7 @@ struct _hb_sanitize_context_t #define SANITIZE_MEM(B,L) HB_LIKELY (context->start <= CONST_CHARP(B) && CONST_CHARP(B) + (L) <= context->end) /* XXX overflow */ -#define NEUTER(Var, Val) (false) +#define NEUTER(Var, Val) (SANITIZE_OBJ (Var) && hb_blob_try_writeable_inplace (context->blob) && ((Var) = (Val), true)) /* @@ -352,13 +352,13 @@ struct GenericOffsetTo : OffsetType if (!SANITIZE_OBJ (*this)) return false; unsigned int offset = *this; if (HB_UNLIKELY (!offset)) return true; - return SANITIZE (CAST(Type, *DECONST_CHARP(base), offset)) || NEUTER (*this, 0); + return SANITIZE (CAST(Type, *DECONST_CHARP(base), offset)) || NEUTER (DECONST_CAST(OffsetType,*this,0), 0); } inline bool sanitize (SANITIZE_ARG_DEF, const void *base, unsigned int user_data) { if (!SANITIZE_OBJ (*this)) return false; unsigned int offset = *this; if (HB_UNLIKELY (!offset)) return true; - return SANITIZE_BASE (CAST(Type, *DECONST_CHARP(base), offset), user_data) || NEUTER (*this, 0); + return SANITIZE_BASE (CAST(Type, *DECONST_CHARP(base), offset), user_data) || NEUTER (DECONST_CAST(OffsetType,*this,0), 0); } }; template <typename Base, typename OffsetType, typename Type> |