Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/mono/mono/mini/abcremoval.c
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ get_relations_from_previous_bb (MonoVariableRelationsEvaluationArea *area, MonoB
symmetric_relation = MONO_SYMMETRIC_RELATION (branch_relation);

/* FIXME: Other compare opcodes */
if (compare->opcode == OP_ICOMPARE) {
if (compare->opcode == OP_ICOMPARE && compare->sreg1 != compare->sreg2) {
relations->relation1.variable = compare->sreg1;
relations->relation1.relation.relation = branch_relation;
relations->relation1.relation.related_value.type = MONO_VARIABLE_SUMMARIZED_VALUE;
Expand Down
33 changes: 33 additions & 0 deletions src/tests/JIT/Regression/JitBlue/Runtime_71592/test71592.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using System.Threading.Tasks;

public class Test
{
public int foo;

public override bool Equals(object o) => false;
public override int GetHashCode() => 0;

public static bool operator ==(Test t1, Test t2) {
if (ReferenceEquals(t1, t1))
return true;
return t1.foo == t2.foo;
}

public static bool operator !=(Test t1, Test t2) {
if (ReferenceEquals(t1, t1))
return true;
return t1.foo == t2.foo;
}

public static int Main () {
var t1 = new Test () { foo = 1 };
var t2 = new Test () { foo = 2 };
if (t1 == t2)
return 100;
return 100;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<CLRTestPriority>0</CLRTestPriority>
</PropertyGroup>
<ItemGroup>
<Compile Include="test71592.cs" />
</ItemGroup>
</Project>