File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 11
22Fixes a bug in knitted markdown documents which caused backtraces to be displayed when they shouldn't.
33
4+ Also fixes one valgrind issue (I can't reproduce the uninitialised value warning locally).
5+
46## Test environments
57
68* local OS X install: release
Original file line number Diff line number Diff line change @@ -49,10 +49,15 @@ sexp* r_lgl_which(sexp* x, bool na_propagate) {
4949 int * data = r_lgl_deref (x );
5050
5151 r_ssize which_n = r_lgl_sum (x , na_propagate );
52+
53+ if (which_n > INT_MAX ) {
54+ r_abort ("Internal error: Can't fit result of `r_lgl_which()` in an integer vector" );
55+ }
56+
5257 sexp * which = KEEP (r_new_vector (r_type_integer , which_n ));
5358 int * which_data = r_int_deref (which );
5459
55- for (r_ssize i = 0 ; i < n ; ++ i , ++ data ) {
60+ for (int i = 0 ; i < n ; ++ i , ++ data ) {
5661 int elt = * data ;
5762
5863 if (elt ) {
You can’t perform that action at this time.
0 commit comments