Commit Graph

80 Commits

Author SHA1 Message Date
Behdad Esfahbod 807c5b03a2 [sanitize] Make debug code always available to the compiler
Such that we don't break debug build all the time.
2010-04-28 23:28:07 -04:00
Behdad Esfahbod a92f0fda7f Fix debug build 2010-04-28 13:09:40 -04:00
Behdad Esfahbod 66d6eb30eb Rename Var to Obj 2010-04-25 23:01:45 -04:00
Behdad Esfahbod ad3653751b Typo 2010-04-23 19:43:40 -04:00
Behdad Esfahbod 990443e5f2 Remove lock_instance() 2010-04-23 17:53:32 -04:00
Behdad Esfahbod 187454c595 Add different casts from pointer and ref to avoid bugs 2010-04-23 17:44:28 -04:00
Behdad Esfahbod efb324a46f Remove GET_FOR_DATA macros
The major-version check is now handled by sanitize.  If major
doesn't match, we reject and fall back to the Null object.
2010-04-23 16:28:27 -04:00
Behdad Esfahbod f1aaa2a436 Add TODO 2010-04-23 15:19:50 -04:00
Behdad Esfahbod 1d720192b1 Fix compile warnings (HB_GNUC_UNUSED) 2010-04-23 14:39:10 -04:00
Behdad Esfahbod 8dfdca599c No need to keep blob in sanitize context 2010-04-23 14:07:34 -04:00
Behdad Esfahbod 254933c397 When sanitizing, delay making writable
Before, as soon as we needed to make an edit, we tried to make the blob
writable inplace.  That grows code unnecessarily though.  We can simply
fail, make writable, then start again.  That's indeed what the fallback
was doing anyway.
2010-04-23 13:57:10 -04:00
Behdad Esfahbod d632ec4000 Cosmetic 2010-04-22 18:42:05 -04:00
Behdad Esfahbod a3263aa773 Convert the last set of cast macros to templates 2010-04-22 18:42:01 -04:00
Behdad Esfahbod c38188a191 Remove unused macro 2010-04-22 16:52:09 -04:00
Behdad Esfahbod dc228048a8 Remove integrity check in Tag sanitize
Serves no useful purpose.
2010-04-22 13:22:41 -04:00
Behdad Esfahbod c293581e96 Add coment 2010-04-22 11:20:28 -04:00
Behdad Esfahbod 1faa76c6e8 Remove unnecessary casts 2010-04-22 10:54:26 -04:00
Behdad Esfahbod 565c80bd29 Make sure semicolon is expected after DEFINE_NULL_DATA() 2010-04-22 10:26:35 -04:00
Behdad Esfahbod e5546a4352 Watch for overflow in Array sanitize 2010-04-22 00:48:54 -04:00
Behdad Esfahbod 4f5f1c34dd Rename const_sub_array to sub_array since all consts are implicit now 2010-04-22 00:27:39 -04:00
Behdad Esfahbod c755cb3e3a Change header comment 2010-04-22 00:11:43 -04:00
Behdad Esfahbod 243d20e011 More cast simplification 2010-04-21 23:57:01 -04:00
Behdad Esfahbod 0dfcc13a46 Rename ConstCharP to CharP (overloaded now) 2010-04-21 23:41:26 -04:00
Behdad Esfahbod 62c0fd7573 Cleanup de-const-casting during sanitize 2010-04-21 23:30:48 -04:00
Behdad Esfahbod dd15587056 Add more comments 2010-04-21 23:13:33 -04:00
Behdad Esfahbod c85c362067 Add comment 2010-04-21 23:12:54 -04:00
Behdad Esfahbod 2467c669c2 Add comment 2010-04-21 23:11:45 -04:00
Behdad Esfahbod 29c3f5e1b6 Improve comment 2010-04-21 23:01:00 -04:00
Behdad Esfahbod 01c01618e9 Further simplify IntType struct defs 2010-04-21 22:49:56 -04:00
Behdad Esfahbod 2cb08458f6 Rename const_array() to array() (overloaded) 2010-04-21 22:37:31 -04:00
Behdad Esfahbod 2e2f43edf2 Remove ArrayAfter, use StructAfter in place 2010-04-21 22:30:36 -04:00
Behdad Esfahbod e961c86c57 Convert NEXT() and ARRAY_AFTER() macros to templates 2010-04-21 15:56:11 -04:00
Behdad Esfahbod 198facdc55 Use templates for const char * casts 2010-04-21 13:35:36 -04:00
Behdad Esfahbod e032ed9f75 Use templates for defining int typess 2010-04-21 04:51:55 -04:00
Behdad Esfahbod 2c9fd2adce Remove unused macro 2010-04-21 02:15:39 -04:00
Behdad Esfahbod 7a52f28117 Rename macros 2010-04-21 02:14:44 -04:00
Behdad Esfahbod 40d73bc68d Improve comments 2010-04-21 01:55:20 -04:00
Behdad Esfahbod 394bad41a7 Remove stale TODO item 2010-04-21 01:55:17 -04:00
Behdad Esfahbod 9d3677899f Use a function template instead of struct template for Null 2010-04-21 01:55:12 -04:00
Behdad Esfahbod ffd321afd9 Simplify Tag struct 2010-04-21 01:55:09 -04:00
Behdad Esfahbod 00e23fcc6f Cosmetic 2010-04-21 01:55:03 -04:00
Behdad Esfahbod f9b3772798 Add couple consts to operators 2010-04-21 01:54:53 -04:00
Behdad Esfahbod 53d237ec63 Remove ASSERT_SIZE_DATA 2010-04-21 01:54:49 -04:00
Behdad Esfahbod 0e206de986 Fix warnings 2010-04-21 01:48:41 -04:00
Behdad Esfahbod d5943407a4 Fix debug build 2010-04-21 01:42:11 -04:00
Behdad Esfahbod 4b8487d83e Fix the mystery bug!
A couple bugs joined forces to exhibit the mystery behavior of
crashes / infinite loops on OS X / wrong kerning / invalid memory
access.  Pooh!

The bugs were involved:

  - Wrong pointer math with ValueRecord in PairPosFormat1

  - Fallout from avoiding flex arrays, code not correctly updated
    to remove sizeof() usage.

We strictly never use sizeof() directly now.  And the PairPos code
is cleaned up.  Should fix them all.  Bugs are:

  Bug 605655 - Pango 1.26.2 introduces kerning bug
  Bug 611229 - Pango reads from uninitialized memory
  Bug 593240 - (pangoosx) Crash / infinite loop with Mac OS X

We were also doing wrong math converting Device adjustments to
hb_position_t.  Fallout from FreeType days.  Should shift 16, not
6.  Fixed that too.

There's still another bug: we don't sanitize Device records
referenced from value records.  Fixing that also.
2010-04-21 01:41:29 -04:00
Behdad Esfahbod 9b39755d10 Typo 2010-04-15 14:00:25 -04:00
Behdad Esfahbod f85ec1c7da Cosmetic 2010-03-10 04:14:40 -05:00
Behdad Esfahbod ecd2e996d2 Improve the alignment for NullPool 2010-02-23 02:42:00 -05:00
Behdad Esfahbod 807b8aa486 Another C++ strictness fix
Pango Bug 602408 - Invalid C++ code breaks compile with Sun C++ Compiler
(Error: A union member cannot have a user-defined assignment operator)

According to the bug:

C++ Programming Language by Bjarne Stroustrup: Chapter 10.4.12 forbids
explicitly using of union members with constructors, destructors or assignment
operations.

So we use a set() method instead of the assignment operator.  Ugly, but hey,
that's life.
2009-11-19 20:35:01 -05:00