From e8a02dd72abe137680505846581b96e8404d786e Mon Sep 17 00:00:00 2001
From: stepan <stepan.sindelar@oracle.com>
Date: Fri, 18 Nov 2016 14:20:16 +0100
Subject: [PATCH] Identical checks the types are the same

---
 .../src/com/oracle/truffle/r/nodes/builtin/base/Identical.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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 600d84a3c0..8fd3c9a5c2 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++) {
-- 
GitLab