shithub: freetype+ttf2subf

Download patch

ref: ea173c04933e43fc920f9d5515a59bbc006fb5ce
parent: 628578c6558abe6e1106f7d23e6466c06b9ce153
author: Werner Lemberg <[email protected]>
date: Sun Jan 11 03:58:54 EST 2015

* src/truetype/ttinterp.c (Ins_JROT, Ins_JROF): Simplify.

Based on a patch from Behdad.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2015-01-11  Werner Lemberg  <[email protected]>
 
+	* src/truetype/ttinterp.c (Ins_JROT, Ins_JROF): Simplify.
+
+	Based on a patch from Behdad.
+
+2015-01-11  Werner Lemberg  <[email protected]>
+
 	* src/truetype/ttinterp.c (Ins_SxVTL): Simplify function call.
 
 2015-01-11  Werner Lemberg  <[email protected]>
--- a/src/truetype/ttinterp.c
+++ b/src/truetype/ttinterp.c
@@ -3348,30 +3348,6 @@
 
   /*************************************************************************/
   /*                                                                       */
-  /* JROT[]:       Jump Relative On True                                   */
-  /* Opcode range: 0x78                                                    */
-  /* Stack:        StkElt int32 -->                                        */
-  /*                                                                       */
-  static void
-  Ins_JROT( TT_ExecContext  exc,
-            FT_Long*        args )
-  {
-    if ( args[1] != 0 )
-    {
-      if ( args[0] == 0 && exc->args == 0 )
-        exc->error = FT_THROW( Bad_Argument );
-      exc->IP += args[0];
-      if ( exc->IP < 0                                             ||
-           ( exc->callTop > 0                                    &&
-             exc->IP > exc->callStack[exc->callTop - 1].Def->end ) )
-        exc->error = FT_THROW( Bad_Argument );
-      exc->step_ins = FALSE;
-    }
-  }
-
-
-  /*************************************************************************/
-  /*                                                                       */
   /* JMPR[]:       JuMP Relative                                           */
   /* Opcode range: 0x1C                                                    */
   /* Stack:        int32 -->                                               */
@@ -3393,6 +3369,21 @@
 
   /*************************************************************************/
   /*                                                                       */
+  /* JROT[]:       Jump Relative On True                                   */
+  /* Opcode range: 0x78                                                    */
+  /* Stack:        StkElt int32 -->                                        */
+  /*                                                                       */
+  static void
+  Ins_JROT( TT_ExecContext  exc,
+            FT_Long*        args )
+  {
+    if ( args[1] != 0 )
+      Ins_JMPR( exc, args );
+  }
+
+
+  /*************************************************************************/
+  /*                                                                       */
   /* JROF[]:       Jump Relative On False                                  */
   /* Opcode range: 0x79                                                    */
   /* Stack:        StkElt int32 -->                                        */
@@ -3402,16 +3393,7 @@
             FT_Long*        args )
   {
     if ( args[1] == 0 )
-    {
-      if ( args[0] == 0 && exc->args == 0 )
-        exc->error = FT_THROW( Bad_Argument );
-      exc->IP += args[0];
-      if ( exc->IP < 0                                             ||
-           ( exc->callTop > 0                                    &&
-             exc->IP > exc->callStack[exc->callTop - 1].Def->end ) )
-        exc->error = FT_THROW( Bad_Argument );
-      exc->step_ins = FALSE;
-    }
+      Ins_JMPR( exc, args );
   }