Skip to content

STRING_ELT as LHS value #377

@eddelbuettel

Description

@eddelbuettel

Luke Tierney emailed me:

I happened to come across the fact that in barrier.cpp you have

// [[Rcpp::register]] void set_string_elt(SEXP x, int i, SEXP value) { STRING_ELT(x, i) = value; }

You can't to that -- using STRING_ELT(x, i) as a LHS breaks the write
barrier and also would mess up reference counting. You have to use
SET_VECTOR_ELT.

Correction forthcoming. Appears to only affect barrier.cpp.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions