Skip to content
Snippets Groups Projects
Commit 90bc007f authored by Florian Angerer's avatar Florian Angerer
Browse files

Fix: missing specialization in CastDoubleNode.

parent 4f5fa3a5
No related branches found
No related tags found
No related merge requests found
......@@ -37,7 +37,6 @@ import com.oracle.truffle.r.runtime.RType;
import com.oracle.truffle.r.runtime.data.RComplex;
import com.oracle.truffle.r.runtime.data.RComplexVector;
import com.oracle.truffle.r.runtime.data.RDataFactory;
import com.oracle.truffle.r.runtime.data.RDoubleSequence;
import com.oracle.truffle.r.runtime.data.RDoubleVector;
import com.oracle.truffle.r.runtime.data.RList;
import com.oracle.truffle.r.runtime.data.RRawVector;
......@@ -164,13 +163,7 @@ public abstract class CastDoubleNode extends CastDoubleBaseNode {
}
@Specialization
protected RDoubleVector doDoubleVector(RDoubleVector operand) {
return operand;
}
@Specialization
protected RDoubleSequence doDoubleVector(RDoubleSequence operand) {
// sequence does not have attributes - nothing to copy or drop
protected RAbstractDoubleVector doDoubleVector(RAbstractDoubleVector operand) {
return operand;
}
......
......@@ -166,14 +166,13 @@ public abstract class CastIntegerNode extends CastIntegerBaseNode {
}
@Specialization
protected RIntVector doDoubleVector(RAbstractDoubleVector operand) {
naCheck.enable(operand);
return vectorCopy(operand, naCheck.convertDoubleVectorToIntData(operand), naCheck.neverSeenNA());
protected RAbstractIntVector doDoubleVector(RAbstractDoubleVector operand) {
return castWithReuse(operand, index -> naCheck.convertDoubleToInt(operand.getDataAt(index)));
}
@Specialization
protected RIntVector doRawVector(RAbstractRawVector operand) {
return createResultVector(operand, index -> RRuntime.raw2int(operand.getDataAt(index)));
protected RAbstractIntVector doRawVector(RAbstractRawVector operand) {
return castWithReuse(operand, index -> RRuntime.raw2int(operand.getDataAt(index)));
}
@Specialization
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment