Skip to content

Commit 575a4e2

Browse files
author
luke
committed
Fixes in R_duplicateAsResizable.
git-svn-id: https://svn.r-project.org/R/trunk@89043 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent 2005045 commit 575a4e2

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/main/memory.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5051,11 +5051,9 @@ SEXP R_duplicateAsResizable(SEXP x)
50515051
error(_("ALTREP objects cannot be made resizable"));
50525052
if (! isVector(x))
50535053
error(_("cannot make non-vector objects resizable"));
5054-
if (! GROWABLE_BIT_SET(x) && XTRUELENGTH(x) != 0)
5055-
error("XTRUELENGTH has been hijacked");
50565054
SEXP val = duplicate(x);
5057-
SET_TRUELENGTH(x, XLENGTH(x));
5058-
SET_GROWABLE_BIT(x);
5055+
SET_TRUELENGTH(val, XLENGTH(val));
5056+
SET_GROWABLE_BIT(val);
50595057
return val;
50605058
}
50615059

0 commit comments

Comments
 (0)