Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STRING_ELT as LHS value #377

Closed
eddelbuettel opened this issue Sep 28, 2015 · 0 comments
Closed

STRING_ELT as LHS value #377

eddelbuettel opened this issue Sep 28, 2015 · 0 comments
Labels

Comments

@eddelbuettel
Copy link
Member

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.

jjallaire added a commit that referenced this issue Sep 28, 2015
replace STRING_ELT with SET_STRING_ELT (closes #377)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant