shithub: freetype+ttf2subf

Download patch

ref: 2652bd54122de9ed7feb5e0478f310ed70703e86
parent: 33f5f24957397d37ff44f27098937f6e1aceed32
author: Jens Claudius <[email protected]>
date: Fri Aug 18 13:20:37 EDT 2006

2006-08-18  Jens Claudius  <[email protected]>

	* freetype2/src/gxvalid/gxvmod.c (GXV_TABLE_DECL): Mark local
	variable `_sfnt' as volatile since it must keep its value across
	a call to ft_setjmp.
	(gxv_validate): Same for local variables `memory' and `valid'.
	(classic_kern_validate): Same for local variables `memory',
	`ckern', and `valid'.

	* freetype2/src/otvalid/otvmod.c (otv_validate): Same for function
	parameter `face' and local variables `base', `gdef', `gpos', `gsub',
	`jstf', and 'valid'.

	* freetype2/src/sfnt/ttcmap.c (tt_face_build_cmaps): Same for
	local variable `cmap'.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2006-08-18  Jens Claudius  <[email protected]>
+
+	* freetype2/src/gxvalid/gxvmod.c (GXV_TABLE_DECL): Mark local
+	variable `_sfnt' as volatile since it must keep its value across
+	a call to ft_setjmp.
+	(gxv_validate): Same for local variables `memory' and `valid'.
+	(classic_kern_validate): Same for local variables `memory',
+	`ckern', and `valid'.
+
+	* freetype2/src/otvalid/otvmod.c (otv_validate): Same for function
+	parameter `face' and local variables `base', `gdef', `gpos', `gsub',
+	`jstf', and 'valid'.
+
+	* freetype2/src/sfnt/ttcmap.c (tt_face_build_cmaps): Same for
+	local variable `cmap'.
+
+
 2006-08-16  David Turner  <[email protected]>
 
     * src/cid/cidgload.c (cid_slot_load_glyph),
--- a/src/gxvalid/gxvmod.c
+++ b/src/gxvalid/gxvmod.c
@@ -72,9 +72,9 @@
   }
 
 
-#define GXV_TABLE_DECL( _sfnt )           \
-          FT_Byte   *_sfnt        = NULL; \
-          FT_ULong  len_ ## _sfnt = 0
+#define GXV_TABLE_DECL( _sfnt )                  \
+          FT_Byte* volatile _sfnt        = NULL; \
+          FT_ULong           len_ ## _sfnt = 0
 
 #define GXV_TABLE_LOAD( _sfnt )                                     \
           if ( ( FT_VALIDATE_ ## _sfnt ## _INDEX < table_count ) && \
@@ -109,10 +109,10 @@
                 FT_Bytes  tables[FT_VALIDATE_GX_LENGTH],
                 FT_UInt   table_count )
   {
-    FT_Memory        memory = FT_FACE_MEMORY( face );
+    FT_Memory volatile       memory = FT_FACE_MEMORY( face );
 
-    FT_Error         error = GXV_Err_Ok;
-    FT_ValidatorRec  valid;
+    FT_Error                 error = GXV_Err_Ok;
+    FT_ValidatorRec volatile valid;
 
     FT_UInt  i;
 
@@ -191,13 +191,13 @@
                          FT_UInt    ckern_flags,
                          FT_Bytes*  ckern_table )
   {
-    FT_Memory        memory = FT_FACE_MEMORY( face );
+    FT_Memory volatile        memory = FT_FACE_MEMORY( face );
 
-    FT_Byte*         ckern     = NULL;
-    FT_ULong         len_ckern = 0;
+    FT_Byte* volatile         ckern     = NULL;
+    FT_ULong                  len_ckern = 0;
 
-    FT_Error         error = GXV_Err_Ok;
-    FT_ValidatorRec  valid;
+    FT_Error                  error = GXV_Err_Ok;
+    FT_ValidatorRec volatile  valid;
 
 
     *ckern_table = NULL;
--- a/src/otvalid/otvmod.c
+++ b/src/otvalid/otvmod.c
@@ -65,18 +65,22 @@
 
 
   static FT_Error
-  otv_validate( FT_Face    face,
-                FT_UInt    ot_flags,
-                FT_Bytes  *ot_base,
-                FT_Bytes  *ot_gdef,
-                FT_Bytes  *ot_gpos,
-                FT_Bytes  *ot_gsub,
-                FT_Bytes  *ot_jstf )
+  otv_validate( FT_Face volatile   face,
+                FT_UInt            ot_flags,
+                FT_Bytes           *ot_base,
+                FT_Bytes           *ot_gdef,
+                FT_Bytes           *ot_gpos,
+                FT_Bytes           *ot_gsub,
+                FT_Bytes           *ot_jstf )
   {
-    FT_Error         error = OTV_Err_Ok;
-    FT_Byte          *base, *gdef, *gpos, *gsub, *jstf;
-    FT_ULong         len_base, len_gdef, len_gpos, len_gsub, len_jstf;
-    FT_ValidatorRec  valid;
+    FT_Error                 error = OTV_Err_Ok;
+    FT_Byte* volatile        base;
+    FT_Byte* volatile        gdef;
+    FT_Byte* volatile        gpos;
+    FT_Byte* volatile        gsub;
+    FT_Byte* volatile        jstf;
+    FT_ULong                 len_base, len_gdef, len_gpos, len_gsub, len_jstf;
+    FT_ValidatorRec volatile valid;
 
 
     base     = gdef     = gpos     = gsub     = jstf     = NULL;
--- a/src/sfnt/ttcmap.c
+++ b/src/sfnt/ttcmap.c
@@ -2273,7 +2273,7 @@
 
       if ( offset && offset <= face->cmap_size - 2 )
       {
-        FT_Byte*                       cmap   = table + offset;
+        FT_Byte* volatile              cmap   = table + offset;
         volatile FT_UInt               format = TT_PEEK_USHORT( cmap );
         const TT_CMap_Class* volatile  pclazz = tt_cmap_classes;
         TT_CMap_Class volatile         clazz;