diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/access/vector/CachedVectorNode.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/access/vector/CachedVectorNode.java index ed260c42883039a61fc928182cd64d33c403fb99..183b7e1e15936803d0dfd43434352de8776b2ee6 100644 --- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/access/vector/CachedVectorNode.java +++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/access/vector/CachedVectorNode.java @@ -77,10 +77,17 @@ abstract class CachedVectorNode extends RBaseNode { } } - @ExplodeLoop protected Object[] filterPositions(Object[] positions) { - // we assume that the positions count cannot change as the isRemovePosition check - // is just based on types and therefore does not change per position instance. + /* + * we assume that the positions count cannot change as the isRemovePosition check is just + * based on types and therefore does not change per position instance. + * + * normally empty positions are just empty but with S3 function dispatch it may happen that + * positions are also of type RMissing. These values should not contribute to the access + * dimensions. + * + * Example test case: dimensions.x<-data.frame(c(1,2), c(3,4)); x[1] + */ assert initializeFilteredPositionsCount(positions) == filteredPositionsLength; if (filteredPositionsLength != -1) { Object[] newPositions = new Object[filteredPositionsLength];