[goffice] Quad: allocate memory before we mess with fpu.



commit 1d54ebd6dbaaa71aec26d55d95f125cac8c6a0e7
Author: Morten Welinder <terra gnome org>
Date:   Wed Mar 14 16:00:57 2018 -0400

    Quad: allocate memory before we mess with fpu.
    
    Evidently musl is more picky about fpu mode.

 ChangeLog              |    5 +++++
 NEWS                   |    3 +++
 goffice/math/go-quad.c |    5 +++--
 3 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 622a7a0..8a0e54b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2018-03-14  Morten Welinder  <terra gnome org>
+
+       * goffice/math/go-quad.c (go_quad_start): Allocate memory before
+       we change fpu state.  Seee bug #794115.
+
 2018-03-13  Morten Welinder <terra gnome org>
 
        * configure.ac: Post-release bump.
diff --git a/NEWS b/NEWS
index cbea12b..cd5e6b4 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,8 @@
 goffice 0.10.40:
 
+Morten:
+       * Fixes required for running with musl.  [#794115]
+
 --------------------------------------------------------------------------
 goffice 0.10.39:
 
diff --git a/goffice/math/go-quad.c b/goffice/math/go-quad.c
index 9908a86..c2ab55f 100644
--- a/goffice/math/go-quad.c
+++ b/goffice/math/go-quad.c
@@ -200,11 +200,12 @@ SUFFIX(go_quad_start) (void)
                fpu_control_t state, newstate;
                fpu_control_t mask =
                        _FPU_EXTENDED | _FPU_DOUBLE | _FPU_SINGLE;
+
                _FPU_GETCW (state);
+               res = g_memdup (&state, sizeof (state));
+
                newstate = (state & ~mask) | _FPU_DOUBLE;
                _FPU_SETCW (newstate);
-
-               res = g_memdup (&state, sizeof (state));
 #else
                /* Hope for the best.  */
 #endif


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]