[Deoptim-commits] r115 - pkg/DEoptim/src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Feb 13 18:28:49 CET 2014


Author: bodanker
Date: 2014-02-13 18:28:49 +0100 (Thu, 13 Feb 2014)
New Revision: 115

Modified:
   pkg/DEoptim/src/de4_0.c
Log:
- fix potential un/protect mis-match


Modified: pkg/DEoptim/src/de4_0.c
===================================================================
--- pkg/DEoptim/src/de4_0.c	2013-08-14 12:15:24 UTC (rev 114)
+++ pkg/DEoptim/src/de4_0.c	2014-02-13 17:28:49 UTC (rev 115)
@@ -108,8 +108,8 @@
   double *gd_bestvalit = REAL(sexp_bestvalit);
 
   /* ensure lower and upper are double */
-  if(TYPEOF(lower) != REALSXP) PROTECT(lower = coerceVector(lower, REALSXP)); P++;
-  if(TYPEOF(upper) != REALSXP) PROTECT(upper = coerceVector(upper, REALSXP)); P++;
+  if(TYPEOF(lower) != REALSXP) {PROTECT(lower = coerceVector(lower, REALSXP)); P++;}
+  if(TYPEOF(upper) != REALSXP) {PROTECT(upper = coerceVector(upper, REALSXP)); P++;}
   double *d_lower      = REAL(lower);
   double *d_upper      = REAL(upper);
 



More information about the Deoptim-commits mailing list