From f3470bce8d2097bb6b1e3a92b5e93169d97e1cad Mon Sep 17 00:00:00 2001 From: Matt Dowle Date: Fri, 25 Sep 2020 01:02:30 -0600 Subject: [PATCH] attempt to fix GLCI segfault in R<3.5 by using length not LENGTH on NULL; #4655 --- src/dogroups.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/dogroups.c b/src/dogroups.c index 9b7b4cbc9..cbf10e09e 100644 --- a/src/dogroups.c +++ b/src/dogroups.c @@ -39,9 +39,12 @@ static bool anySpecialStatic(SEXP x) { // with PR#4164 started to copy input list columns too much. Hence PR#4655 in v1.13.2 moved that copy here just where it is needed. // Currently the marker is negative truelength. These specials are protected by us here and before we release them // we restore the true truelength for when R starts to use vector truelength. + const int n = length(x); + if (n==0) + return false; if (isVectorAtomic(x)) return TRUELENGTH(x)<0; - if (isNewList(x)) for (int i=0; i