Skip to content
Snippets Groups Projects
Commit d655c200 authored by Mayo Roettger's avatar Mayo Roettger
Browse files

fixed PROTECT bug

parent de5cfb0a
No related branches found
No related tags found
Loading
......@@ -2,7 +2,7 @@ Package: glpkAPI
Type: Package
Title: R Interface to C API of GLPK
Version: 1.3.1
Date: 2018-09-03
Date: 2018-09-13
Authors@R: c(person("Mayo", "Roettger", email = "mayo.roettger@hhu.de", role = "cre"),
person("Gabriel", "Gelius-Dietrich", role = "aut", email = "geliudie@uni-duesseldorf.de"),
person("Louis", "Luangkesorn", email = "lugerpitt@gmail.com", role = "ctb" ))
......@@ -13,7 +13,7 @@ SystemRequirements: GLPK (>= 4.42)
License: GPL-3
LazyLoad: yes
Collate: generics.R glpk_ptrClass.R glpk.R glpkAPI.R zzz.R
Packaged: 2018-09-03 08:30:00 UTC; mayo
Packaged: 2018-09-13 14:05:00 UTC; mayo
NeedsCompilation: yes
Repository: CRAN
Date/Publication: 2018-09-03 08:30:00
Date/Publication: 2018-09-13 14:05:00
......@@ -5,8 +5,10 @@
\encoding{UTF-8}
% ---------------------------------------------------------------------------- %
\section{Changes in version 1.3.1 2018-08-22}{
\section{Changes in version 1.3.1 2018-09-13}{
\itemize{
\item{fixed a bug where an allocating function was called with an unprotected
allocated R object in a makro funtion defined in \file{glpkAPI.h}.}
\item{changed package maintainer}
}
}
......
......@@ -145,7 +145,7 @@
const int *rm = INTEGER(m); \
const int *rn = INTEGER(n); \
oind = R_Calloc(Rf_asInteger(ne), int); \
R_orderVector(oind, Rf_asInteger(ne), Rf_lang2(m, n), TRUE, FALSE); \
R_orderVector(oind, Rf_asInteger(ne), PROTECT(Rf_lang2(m, n)), TRUE, FALSE); \
while (y < Rf_asInteger(ne)) { \
if ( (rm[oind[y-1]] == rm[oind[y]]) && (rn[oind[y-1]] == rn[oind[y]]) ) { \
dupA = oind[y-1]; \
......@@ -158,6 +158,7 @@
if (dupB) { \
Rf_error("Duplicate indices 'ia[%i] = ia[%i] = %i' and 'ja[%i] = ja[%i] = %i' not allowed!", dupA+1, dupB+1, rm[dupA], dupA+1, dupB+1, rn[dupB]); \
} \
UNPROTECT(1)
} while (0)
#else
#define checkDupIndices(m, n, ne)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment