Skip to content
Snippets Groups Projects
Commit e8a02dd7 authored by stepan's avatar stepan
Browse files

Identical checks the types are the same

parent 8a3be878
No related branches found
No related tags found
No related merge requests found
......@@ -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++) {
......
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