Skip to content

Commit f61948e

Browse files
committed
Need to undo this.
1 parent 247ad9a commit f61948e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/programming.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,8 @@ SEXP setcopyv(SEXP x, SEXP val, SEXP rep, SEXP Rinvert, SEXP Rset, SEXP Rind1) {
404404
}
405405
case VECSXP:
406406
{
407-
SEXP *restrict px = (set == 0) ? SEXPPTR(ans) : ALTREP(x) ? (SEXP *)ALTVEC_DATAPTR(x) : SEXPPTR(x);
407+
if(set && ALTREP(x)) error("cannot modify ALTREP list by reference");
408+
SEXP *restrict px = set ? SEXPPTR(x) : SEXPPTR(ans);
408409
if(lv == 1 && ind1 == 0) error("Cannot compare lists to a value");
409410
// if(tr != VECSXP) error("If X is a list and xlist = TRUE, R also needs to be a list");
410411
const int *restrict pv = INTEGER(val); // ALTREP(val) ? (const int *)ALTVEC_DATAPTR(val) :

0 commit comments

Comments
 (0)