diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Identical.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Identical.java index 600d84a3c05a608c1cfca0d6ac255d4068d88790..8fd3c9a5c26741f55ac46624ec0bc8f6e5bc5f03 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Identical.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/Identical.java @@ -84,6 +84,7 @@ public abstract class Identical extends RBuiltinNode { } private final ConditionProfile vecLengthProfile = ConditionProfile.createBinaryProfile(); + private final ConditionProfile differentTypesProfile = ConditionProfile.createBinaryProfile(); // Note: the execution of the recursive cases is not done directly and not through RCallNode or // similar, this means that the visibility handling is left to us. @@ -241,7 +242,7 @@ public abstract class Identical extends RBuiltinNode { @Specialization(guards = "!vectorsLists(x, y)") protected byte doInternalIdenticalGeneric(RAbstractVector x, RAbstractVector y, boolean numEq, boolean singleNA, boolean attribAsSet, boolean ignoreBytecode, boolean ignoreEnvironment) { - if (vecLengthProfile.profile(x.getLength() != y.getLength())) { + if (vecLengthProfile.profile(x.getLength() != y.getLength()) || differentTypesProfile.profile(x.getRType() != y.getRType())) { return RRuntime.LOGICAL_FALSE; } else { for (int i = 0; i < x.getLength(); i++) {