[Libreoffice-commits] core.git: external/coinmp RepositoryExternal.mk sccomp/source

Caolán McNamara caolanm at redhat.com
Fri Jun 6 06:56:53 PDT 2014


 RepositoryExternal.mk                     |    1 +
 external/coinmp/UnpackedTarball_coinmp.mk |    1 +
 external/coinmp/werror-undef.patch.0      |   11 +++++++++++
 sccomp/source/solver/CoinMPSolver.cxx     |   11 ++++++++++-
 4 files changed, 23 insertions(+), 1 deletion(-)

New commits:
commit 67b4b34cce4abf745b24c858d533a25c291b5093
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Jun 6 14:32:09 2014 +0100

    coverity#1202902 Uncaught CoinError exception
    
    Change-Id: I93488fa942f1975b9c32be6d37fc76ea955a2067

diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk
index 640452d..443ea6f 100644
--- a/RepositoryExternal.mk
+++ b/RepositoryExternal.mk
@@ -2217,6 +2217,7 @@ $(call gb_LinkTarget_add_libs,$(1),\
 endif
 $(call gb_LinkTarget_set_include,$(1),\
    -I$(call gb_UnpackedTarball_get_dir,coinmp)/CoinMP/src \
+   -I$(call gb_UnpackedTarball_get_dir,coinmp)/CoinUtils/src \
    $$(INCLUDE) \
 )
 
diff --git a/external/coinmp/UnpackedTarball_coinmp.mk b/external/coinmp/UnpackedTarball_coinmp.mk
index 831f65f..d2d9f0c 100644
--- a/external/coinmp/UnpackedTarball_coinmp.mk
+++ b/external/coinmp/UnpackedTarball_coinmp.mk
@@ -19,6 +19,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,coinmp,\
 	external/coinmp/android.build.patch.1 \
 	external/coinmp/no-binaries.patch.1 \
 	external/coinmp/werror-format-security.patch.0 \
+	external/coinmp/werror-undef.patch.0 \
 	external/coinmp/windows.build.patch.1 \
 ))
 
diff --git a/external/coinmp/werror-undef.patch.0 b/external/coinmp/werror-undef.patch.0
new file mode 100644
index 0000000..a9b80f2
--- /dev/null
+++ b/external/coinmp/werror-undef.patch.0
@@ -0,0 +1,11 @@
+--- CoinUtils/src/config_coinutils_default.h	2014-06-06 14:28:06.872113540 +0100
++++ CoinUtils/src/config_coinutils_default.h	2014-06-06 14:28:29.400294129 +0100
+@@ -26,7 +26,7 @@
+   all of this inside the guard for MSC_VER >= 1200. If you're reading this
+   and have been developing in MSVS long enough to know, fix it.  -- lh, 100915 --
+ */
+-#if _MSC_VER >= 1200
++#if defined _MSC_VER && _MSC_VER >= 1200
+ # include <BaseTsd.h>
+ # define COIN_INT64_T INT64
+ # define COIN_UINT64_T UINT64
diff --git a/sccomp/source/solver/CoinMPSolver.cxx b/sccomp/source/solver/CoinMPSolver.cxx
index f1ee10b..7a016b1 100644
--- a/sccomp/source/solver/CoinMPSolver.cxx
+++ b/sccomp/source/solver/CoinMPSolver.cxx
@@ -18,6 +18,7 @@
  */
 
 #include <CoinMP.h>
+#include <CoinError.hpp>
 
 #include "SolverComponent.hxx"
 #include "solver.hrc"
@@ -313,7 +314,15 @@ void SAL_CALL CoinMPSolver::solve() throw(uno::RuntimeException, std::exception)
     // solve model
 
     nResult = CoinCheckProblem( hProb );
-    nResult = CoinOptimizeProblem( hProb, 0 );
+
+    try
+    {
+        nResult = CoinOptimizeProblem( hProb, 0 );
+    }
+    catch (const CoinError& e)
+    {
+        throw std::runtime_error(e.message());
+    }
 
     mbSuccess = ( nResult == SOLV_CALL_SUCCESS );
     if ( mbSuccess )


More information about the Libreoffice-commits mailing list