diff libinterp/dldfcn/fftw.cc @ 24661:02989d7d68dc

fftw: report error if FFTW library fails to return wisdom (bug #52244) * fftw.cc (Ffftw): Report an error if the FFTW library fails to return a valid wisdom string. Resolves a fatal error when building with the Intel MKL implementation of FFTW, which does not implement wisdom.
author Mike Miller <mtmiller@octave.org>
date Wed, 31 Jan 2018 17:15:47 -0800
parents 194eb4bd202b
children 6652d3823428
line wrap: on
line diff
--- a/libinterp/dldfcn/fftw.cc	Wed Jan 31 16:18:24 2018 -0500
+++ b/libinterp/dldfcn/fftw.cc	Wed Jan 31 17:15:47 2018 -0800
@@ -232,6 +232,9 @@
           std::string arg1 = args(1).xstring_value ("fftw: WISDOM must be a string");
 
           char *str = fftw_export_wisdom_to_string ();
+          if (! str)
+            error ("fftw: could not get current FFTW wisdom");
+
           std::string wisdom_str (str);
           free (str);
 
@@ -245,6 +248,9 @@
       else //dwisdom getter
         {
           char *str = fftw_export_wisdom_to_string ();
+          if (! str)
+            error ("fftw: could not get current FFTW wisdom");
+
           std::string wisdom_str (str);
           free (str);
           retval = octave_value (wisdom_str);
@@ -262,6 +268,9 @@
           std::string arg1 = args(1).xstring_value ("fftw: WISDOM must be a string");
 
           char *str = fftwf_export_wisdom_to_string ();
+          if (! str)
+            error ("fftw: could not get current FFTW wisdom");
+
           std::string wisdom_str (str);
           free (str);
 
@@ -275,6 +284,9 @@
       else //swisdom getter
         {
           char *str = fftwf_export_wisdom_to_string ();
+          if (! str)
+            error ("fftw: could not get current FFTW wisdom");
+
           std::string wisdom_str (str);
           free (str);
           retval = octave_value (wisdom_str);