Merge pull request #1201 from rstudio/bugfix/avoid-radix-sort-overflow

avoid overflow in R 3.3.0 radix sort
This commit is contained in:
Winston Chang
2016-05-27 21:39:15 -05:00

View File

@@ -627,7 +627,10 @@ Callbacks <- R6Class(
.callbacks = 'Map',
initialize = function() {
.nextId <<- as.integer(.Machine$integer.max)
# NOTE: we avoid using '.Machine$integer.max' directly
# as R 3.3.0's 'radixsort' could segfault when sorting
# an integer vector containing this value
.nextId <<- as.integer(.Machine$integer.max - 1L)
.callbacks <<- Map$new()
},
register = function(callback) {