Skip to content

Commit

Permalink
Unifier.IsCompatibleWithPointer: add missing brackets around (Domain.…
Browse files Browse the repository at this point in the history
…Selector | Domain.Pointer)
  • Loading branch information
ptomin committed Dec 12, 2023
1 parent 434ab82 commit ba91740
Show file tree
Hide file tree
Showing 138 changed files with 132,991 additions and 102,719 deletions.
2 changes: 1 addition & 1 deletion src/Core/Types/Unifier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ private bool IsCompatibleWithPointer(Pointer ptrA, DataType b, int depth)
}
if (b is PrimitiveType pb)
{
if ((pb.Domain & Domain.Selector | Domain.Pointer) != 0 && pb.Size == ptrA.Size)
if ((pb.Domain & (Domain.Selector | Domain.Pointer)) != 0 && pb.Size == ptrA.Size)
return true;
}
return false;
Expand Down
9 changes: 5 additions & 4 deletions src/UnitTests/Decompiler/Evaluation/IdConstantTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,12 @@ public void Idc_ConstantReferencePointerToInt()
var ctx = new Mock<EvaluationContext>();
ctx.Setup(c => c.GetValue(edx)).Returns(Constant.Int32(0x567));

IdConstant ic = new IdConstant();
var e = ic.Match(edx, ctx.Object, new Unifier(null, null), listener);
IdConstant ic = new IdConstant();
var factory = new TypeFactory();
var e = ic.Match(edx, ctx.Object, new Unifier(factory, null), listener);
Assert.That(e, Is.Not.Null);
Assert.AreEqual("00000567", e.ToString());
Assert.AreEqual("(ptr32 int32)", e.DataType.ToString());
Assert.AreEqual("0x567<32>", e.ToString());
Assert.AreEqual("(union (int32 u0) (INTPTR u1))", e.DataType.ToString());
}

[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -802,8 +802,8 @@ define proc1
proc1_entry:
// succ: l1
l1:
eax2 = *eax1
eax3 = *eax2
eax2 = (real32 **) *eax1
eax3 = (real32 *) *eax2
g_r1004 = *eax3
proc1_exit:
Expand Down
34 changes: 23 additions & 11 deletions subjects/Archives/ArTar/hello.reko/hello_O1.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 0 additions & 9 deletions subjects/Archives/ArTar/hello.reko/hello_O1_init_array.c

This file was deleted.

12 changes: 6 additions & 6 deletions subjects/Archives/ArTar/hello.reko/hello_O1_text.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion subjects/CPM-80/CB80_code.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ba91740

Please sign in to comment.