Commit ad83e05b3798d95d2a52d9707489560ea263f619

Werner Lemberg 2008-06-15T11:06:12

* src/base/ftcalc.c (FT_MulFix) <asm>: Protect registers correctly from clobbering. Patch from Savannah bug report #23556. * docs/CHANGES: Document it.

diff --git a/ChangeLog b/ChangeLog
index f712cce..ae62f7f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-06-15  Werner Lemberg  <wl@gnu.org>
+
+	* src/base/ftcalc.c (FT_MulFix) <asm>: Protect registers correctly
+	from clobbering.  Patch from Savannah bug report #23556.
+
+	* docs/CHANGES: Document it.
+
 2008-06-10  Werner Lemberg  <wl@gnu.org>
 
 	* autogen.sh: Add option `--install' to libtoolize.
diff --git a/docs/CHANGES b/docs/CHANGES
index 8129ec7..ade991b 100644
--- a/docs/CHANGES
+++ b/docs/CHANGES
@@ -1,3 +1,15 @@
+CHANGES BETWEEN 2.3.7 and 2.3.6
+
+  I. IMPORTANT BUG FIXES
+
+    - If the library  was compiled on an i386  platform using gcc, and
+      compiler  option -O3 was  given, `FT_MulFix'  sometimes returned
+      incorrect  results   which  could  have   caused  problems  with
+      `FT_Request_Metrics'   and  `FT_Select_Metrics',   returning  an
+      incorrect descender size.
+
+
+======================================================================
 
 CHANGES BETWEEN 2.3.6 and 2.3.5
 
diff --git a/src/base/ftcalc.c b/src/base/ftcalc.c
index 17790c3..c69b9f6 100644
--- a/src/base/ftcalc.c
+++ b/src/base/ftcalc.c
@@ -430,8 +430,8 @@
       "shll  $16, %%edx\n"
       "addl  %%edx, %%eax\n"
       "mov   %%eax, %0\n"
-      : "=r"(result)
-      : "a"(a), "d"(b)
+      : "=a"(result), "+d"(b)
+      : "a"(a)
       : "%ecx"
     );
     return result;