ref: 8ce3026304d3167c1f7b6b36d75a139050145b11
parent: dac5644ceaf07cf8c13b639bae176af7bb42643c
author: Werner Lemberg <[email protected]>
date: Fri Mar 27 04:33:47 EDT 2015
[cff] Trace charstring nesting levels. * src/cff/cf2intrp.c (cf2_interpT2CharString) <cf2_cmdCALLGSUBR, cf2_cmdCALLSUBR, cf2_cmdRETURN>: Implement it. * src/cff/cffgload.c (cff_decoder_parse_charstrings) <cff_op_callsubr, cff_op_callgsubr, cff_op_return>: Ditto.
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2015-03-27 Werner Lemberg <[email protected]>
+
+ [cff] Trace charstring nesting levels.
+
+ * src/cff/cf2intrp.c (cf2_interpT2CharString) <cf2_cmdCALLGSUBR,
+ cf2_cmdCALLSUBR, cf2_cmdRETURN>: Implement it.
+
+ * src/cff/cffgload.c (cff_decoder_parse_charstrings)
+ <cff_op_callsubr, cff_op_callgsubr, cff_op_return>: Ditto.
+
2015-03-21 Alexei Podtelezhnikov <[email protected]>
[base] Optimize `FT_Angle_Diff'.
--- a/src/cff/cf2intrp.c
+++ b/src/cff/cf2intrp.c
@@ -771,8 +771,9 @@
switch ( op1 )
{
case cf2_cmdCALLGSUBR:
- FT_TRACE4(( "(%d)\n",
- subrIndex + (CF2_UInt)decoder->globals_bias ));
+ FT_TRACE4(( " (idx %d, entering level %d)\n",
+ subrIndex + (CF2_UInt)decoder->globals_bias,
+ charstringIndex + 1 ));
if ( cf2_initGlobalRegionBuffer( decoder,
subrIndex,
@@ -785,8 +786,9 @@
default:
/* cf2_cmdCALLSUBR */
- FT_TRACE4(( "(%d)\n",
- subrIndex + (CF2_UInt)decoder->locals_bias ));
+ FT_TRACE4(( " (idx %d, entering level %d)\n",
+ subrIndex + (CF2_UInt)decoder->locals_bias,
+ charstringIndex + 1 ));
if ( cf2_initLocalRegionBuffer( decoder,
subrIndex,
@@ -802,7 +804,7 @@
continue; /* do not clear the stack */
case cf2_cmdRETURN:
- FT_TRACE4(( " return\n" ));
+ FT_TRACE4(( " return (leaving level %d)\n", charstringIndex ));
if ( charstringIndex < 1 )
{
--- a/src/cff/cffgload.c
+++ b/src/cff/cffgload.c
@@ -2389,7 +2389,9 @@
decoder->locals_bias );
- FT_TRACE4(( " callsubr(%d)\n", idx ));
+ FT_TRACE4(( " callsubr (idx %d, entering level %d)\n",
+ idx,
+ zone - decoder->zones + 1 ));
if ( idx >= decoder->num_locals )
{
@@ -2431,7 +2433,9 @@
decoder->globals_bias );
- FT_TRACE4(( " callgsubr(%d)\n", idx ));
+ FT_TRACE4(( " callgsubr (idx %d, entering level %d)\n",
+ idx,
+ zone - decoder->zones + 1 ));
if ( idx >= decoder->num_globals )
{
@@ -2468,7 +2472,8 @@
break;
case cff_op_return:
- FT_TRACE4(( " return\n" ));
+ FT_TRACE4(( " return (leaving level %d)\n",
+ decoder->zone - decoder->zones ));
if ( decoder->zone <= decoder->zones )
{