Displaying 2 results from an estimated 2 matches for "integersubscript".
2009 Nov 03
1
memory misuse in subscript code when rep() is called in odd way
...n rev 50178
language R
version.string R version 2.11.0 Under development (unstable) (2009-10-20
r50178)
valgrind says that the C code is using uninitialized data:
> rep(1:4, 1:8, each=2)
==26459== Conditional jump or move depends on uninitialised value(s)
==26459== at 0x80C557D: integerSubscript (subscript.c:408)
==26459== by 0x80C5EDC: Rf_vectorSubscript (subscript.c:658)
==26459== by 0x80C5FFD: Rf_makeSubscript (subscript.c:613)
==26459== by 0x80C7368: do_subset_dflt (subset.c:158)
==26459== by 0x80B4283: do_rep (Rinlinedfuns.h:161)
==26459== by 0x816491B: Rf_eval (eval.c:...
2010 Sep 08
0
Correction to vec-subset speed patch
......" and "[<-..." in ./subset.c, ./subassign.c
*/
@@ -411,7 +410,7 @@
return s;
}
-static SEXP positiveSubscript(SEXP s, int ns, int nx)
+static SEXP nonnegativeSubscript(SEXP s, int ns, int nx)
{
SEXP indx;
int i, zct = 0;
@@ -433,34 +432,53 @@
static SEXP integerSubscript(SEXP s, int ns, int nx, int *stretch, SEXP call)
{
int i, ii, min, max, canstretch;
- Rboolean isna = FALSE;
+ Rboolean isna;
+
canstretch = *stretch;
*stretch = 0;
- min = 0;
- max = 0;
+
for (i = 0; i < ns; i++) {
ii = INTEGER(s)[i];
- if (ii != NA_INTEGER) {...