diff --git a/src/main/envir.c b/src/main/envir.c index ebe74dbf44d..53344509074 100644 --- a/src/main/envir.c +++ b/src/main/envir.c @@ -3316,7 +3316,7 @@ static void R_StringHash_resize(unsigned int newsize) /* move the current chain link to the new chain */ #ifdef USE_ATTRIB_FIELD_FOR_CHARSXP_CACHE_CHAINS /* this is a destrictive modification */ - new_chain = SET_CXTAIL(val, new_chain) + new_chain = SET_CXTAIL(val, new_chain); SET_VECTOR_ELT(new_table, new_hashcode, new_chain); #else SET_VECTOR_ELT(new_table, new_hashcode, CONS(val, new_chain)); diff --git a/src/main/memory.c b/src/main/memory.c index 1e76ac22d4e..6e7447f4a55 100644 --- a/src/main/memory.c +++ b/src/main/memory.c @@ -421,7 +421,8 @@ static R_size_t R_NodesInUse = 0; part of a hash chain. Theoretically, for CHARSXPs the ATTRIB field should always be either R_NilValue or a CHARSXP. */ # define HAS_GENUINE_ATTRIB(x) \ - (ATTRIB(x) != R_NilValue && TYPEOF(ATTRIB(x)) != CHARSXP) + (ATTRIB(x) != R_NilValue && \ + (TYPEOF(x) != CHARSXP || TYPEOF(ATTRIB(x)) != CHARSXP)) #else # define HAS_GENUINE_ATTRIB(x) (ATTRIB(x) != R_NilValue) #endif