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

[.xts segfaults if missing i, j=NA, and object has column names #181

Closed
joshuaulrich opened this issue Apr 21, 2017 · 0 comments
Closed
Assignees
Labels

Comments

@joshuaulrich
Copy link
Owner

joshuaulrich commented Apr 21, 2017

ii <- xts::.xts(matrix(1:10, 5, 2), 1:5)
ii[, NA]  # OK

colnames(ii) <- c("i", "j")
ii[1:5, NA]  # Also OK

# ... but
ii[, NA]  # KA-BOOM!

The fact that it works when i is specified suggests the problem is in extract_col.

@joshuaulrich joshuaulrich self-assigned this Apr 21, 2017
@joshuaulrich joshuaulrich changed the title [.xts segfaults if j is NA and object has column names [.xts segfaults if missing i, j=NA, and object has column names Apr 21, 2017
joshuaulrich added a commit that referenced this issue Apr 21, 2017
extract_col() did not check for missing values in j when copying column
names, which would cause a segfault. Add test for this case.

Fixes #181.
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