Re: [Rd] v3 serialization of compact_intseq altrep should write modified data

2018-10-22 Thread Tierney, Luke
Try this C code: SEXP set_intseq_data(SEXP x) { if (MAYBE_SHARED(x)) error("Oops, not supposed to do this!"); void* ptr = DATAPTR(x); ((int*)ptr)[3] = 1234; return R_NilValue; } Lots of things will break if you modify objects that have been marked as immutable (and hen

[Rd] v3 serialization of compact_intseq altrep should write modified data

2018-10-22 Thread Michael Sannella via R-devel
Experimenting with altrep objects and v3 serialization, I discovered a possible bug. Calling DATAPTR on a compact_intseq object returns a pointer to the expanded integer sequence in memory. If you modify this data, the object values appear to be changed. However, if the compact_intseq object is