Trying to run setattr(numeric(1), "class", character(0)) or setattr(numeric(1), character(0), "value") crashes because the setattrib c function doesn't check if the value or name string vector actually has length > 0 before accessing it with STRING_ELT.
Trying to run setattr(numeric(1), "class", character(0)) or setattr(numeric(1), character(0), "value") crashes because the setattrib c function doesn't check if the value or name string vector actually has length > 0 before accessing it with STRING_ELT.