We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2e7cce6 commit e5c7c73Copy full SHA for e5c7c73
src/main/memory.c
@@ -5075,7 +5075,11 @@ void R_resizeVector(SEXP x, R_xlen_t newlen)
5075
if (getAttrib(x, R_DimNamesSymbol) != R_NilValue)
5076
error(_("can't resize a vector with a 'dimnames' attribute"));
5077
SEXP names = getAttrib(x, R_NamesSymbol);
5078
- R_resizeVector(names, newlen);
+ if (names != R_NilValue) {
5079
+ if (MAYBE_SHARED(names))
5080
+ error(_("can't resize 'names' might be shared"));
5081
+ R_resizeVector(names, newlen);
5082
+ }
5083
}
5084
R_xlen_t len = XLENGTH(x);
5085
if (newlen < len) // clear dropped elements to drop refcounts
0 commit comments