Skip to content

Commit 62f274a

Browse files
committed
Check for ALTREP
1 parent e9a323d commit 62f274a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/assign.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -497,11 +497,12 @@ SEXP assign(SEXP dt, SEXP rows, SEXP cols, SEXP newcolnames, SEXP values)
497497
if (length(rows)==0 && targetlen==vlen && (vlen>0 || nrow==0)) {
498498
if ( MAYBE_SHARED(thisvalue) || // set() protects the NAMED of atomic vectors from .Call setting arguments to 2 by wrapping with list
499499
(TYPEOF(values)==VECSXP && i>LENGTH(values)-1) || // recycled RHS would have columns pointing to others, #185.
500-
(TYPEOF(values)!=VECSXP && i>0) // assigning the same values to a second column. Have to ensure a copy #2540
500+
(TYPEOF(values)!=VECSXP && i>0) || // assigning the same values to a second column. Have to ensure a copy #2540
501+
ALTREP(thisvalue)
501502
) {
502503
if (verbose) {
503-
Rprintf(_("RHS for item %d has been duplicated because NAMED==%d MAYBE_SHARED==%d, but then is being plonked. length(values)==%d; length(cols)==%d)\n"),
504-
i+1, NAMED(thisvalue), MAYBE_SHARED(thisvalue), length(values), length(cols));
504+
Rprintf(_("RHS for item %d has been duplicated because NAMED==%d MAYBE_SHARED==%d ALTREP==%d, but then is being plonked. length(values)==%d; length(cols)==%d)\n"),
505+
i+1, NAMED(thisvalue), MAYBE_SHARED(thisvalue), ALTREP(thisvalue), length(values), length(cols));
505506
}
506507
thisvalue = copyAsPlain(thisvalue); // PROTECT not needed as assigned as element to protected list below.
507508
} else {

0 commit comments

Comments
 (0)