Skip to content

Commit b8abbfb

Browse files
committed
Fix protection issue in dots capture
1 parent bf6b4e4 commit b8abbfb

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

cran-comments.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
Fixes the rchk problems. However, rchk warnings remain after the fix which AFAICS are false positives. I have contacted Tomas Kalibera about it. Refactoring the code to work around the warnings would be too dangerous for a quick release (dots capture in the tidyverse relies on it).
2+
Fixes the rchk problems.
33

44
## Test environments
55

src/internal/dots.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -478,16 +478,15 @@ sexp* dots_expand(sexp* dots, struct dots_capture_info* capture_info) {
478478

479479
sexp* name = r_nms_get(names, i);
480480
if (name != r_string("")) {
481-
// Serialised unicode points might arise when unquoting
482-
// lists because of the conversion to pairlist
483-
name = KEEP(r_str_unserialise_unicode(name));
484-
485481
// Names might not be initialised when dots are captured by value
486482
if (out_names == r_null) {
487483
out_names = KEEP_N(init_names(out), n_protect);
488484
}
489-
r_chr_poke(out_names, count, name);
490485

486+
// Serialised unicode points might arise when unquoting
487+
// lists because of the conversion to pairlist
488+
name = KEEP(r_str_unserialise_unicode(name));
489+
r_chr_poke(out_names, count, name);
491490
FREE(1);
492491
}
493492

0 commit comments

Comments
 (0)