Skip to content

Commit

Permalink
Fix UBSAN issues in lp_solve
Browse files Browse the repository at this point in the history
  • Loading branch information
vissarion committed Apr 11, 2023
1 parent 5ec57dd commit 37d7c84
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions R-proj/DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ Description: Provides an R interface for 'volesti' C++ package. 'volesti' comput
for sampling, rounding and rotating polytopes. Moreover, 'volesti' provides algorithms for
estimating copulas useful in computational finance. Methods implemented in 'volesti' are described
in A. Chalkis and V. Fisikopoulos (2022) <doi:10.32614/RJ-2021-077> and references therein.
Version: 1.1.2-4
Date: 2022-04-03
Version: 1.1.2-6
Date: 2023-04-11
Maintainer: Vissarion Fisikopoulos <vissarion.fisikopoulos@gmail.com>
Depends: Rcpp (>= 0.12.17)
Imports: methods, stats
Expand Down
10 changes: 6 additions & 4 deletions R-proj/src/Rproj_externals/lp_solve/lp_presolve.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
initial version of column aggregation code.
------------------------------------------------------------------------- */

//Modified by Apostolos Chalkis in May of 2020.

#include <string.h>
#include "commonlib.h"
#include "lp_lib.h"
Expand Down Expand Up @@ -170,13 +168,17 @@ STATIC MYBOOL presolve_rebuildUndo(lprec *lp, MYBOOL isprimal)
if(isprimal) {
if(psdata->primalundo != NULL)
mat = psdata->primalundo->tracker;
solution = lp->full_solution + lp->presolve_undo->orig_rows; // Comment out by Apostolos Chalkis
if(mat == NULL)
return( FALSE );
solution = lp->full_solution + lp->presolve_undo->orig_rows;
slacks = lp->full_solution;
}
else {
if(psdata->dualundo != NULL)
mat = psdata->dualundo->tracker;
solution = lp->full_duals; // Comment out by Apostolos Chalkis
if(mat == NULL)
return( FALSE );
solution = lp->full_duals;
slacks = lp->full_duals + lp->presolve_undo->orig_rows;
}
if(mat == NULL)
Expand Down
1 change: 0 additions & 1 deletion cran_gen/Makevars
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
PKG_CPPFLAGS=-Iexternal -Iexternal/lpsolve/headers/run_headers -Iexternal/minimum_ellipsoid -Iinclude -Iinclude/convex_bodies/spectrahedra
PKG_CXXFLAGS= -DBOOST_NO_AUTO_PTR
CXX_STD = CXX11

PKG_LIBS=-Lexternal/lpsolve/build/lp_solve -llp_solve $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)

Expand Down
1 change: 0 additions & 1 deletion cran_gen/Makevars.win
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
PKG_CPPFLAGS=-Iexternal -Iexternal/lpsolve/headers/run_headers -Iexternal/minimum_ellipsoid -Iinclude -Iinclude/convex_bodies/spectrahedra
PKG_CXXFLAGS= -lm -ldl -DBOOST_NO_AUTO_PTR
CXX_STD = CXX11

PKG_LIBS=-Lexternal/lpsolve/build/lp_solve -llp_solve $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)

Expand Down
6 changes: 5 additions & 1 deletion cran_gen/NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,8 @@

# volesti 1.1.2-4

- Remove uninitialized warning in clang-16 (lp_presolve)
- Remove uninitialized warning in clang-16 (lp_presolve)

# volesti 1.1.2-6

- Fix UBSAN issues (lp_presolve)

0 comments on commit 37d7c84

Please sign in to comment.