From 2652bd54122de9ed7feb5e0478f310ed70703e86 Mon Sep 17 00:00:00 2001 From: Jens Claudius Date: Fri, 18 Aug 2006 17:20:37 +0000 Subject: [PATCH] 2006-08-18 Jens Claudius * 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'. --- ChangeLog | 17 +++++++++++++++++ src/gxvalid/gxvmod.c | 22 +++++++++++----------- src/otvalid/otvmod.c | 26 +++++++++++++++----------- src/sfnt/ttcmap.c | 2 +- 4 files changed, 44 insertions(+), 23 deletions(-) diff --git a/ChangeLog b/ChangeLog index d0903825..62a0f442 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2006-08-18 Jens Claudius + + * 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 * src/cid/cidgload.c (cid_slot_load_glyph), diff --git a/src/gxvalid/gxvmod.c b/src/gxvalid/gxvmod.c index c62a63ad..2f8d2462 100644 --- 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; diff --git a/src/otvalid/otvmod.c b/src/otvalid/otvmod.c index 58f7eb77..63416616 100644 --- 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; diff --git a/src/sfnt/ttcmap.c b/src/sfnt/ttcmap.c index 3a43aedc..ce1dc0c8 100644 --- 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;