• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

SamboyCoding / Cpp2IL / 17216182984

25 Aug 2025 05:35PM UTC coverage: 30.38% (-4.0%) from 34.352%
17216182984

Pull #481

github

web-flow
Merge b82763a24 into d5260685f
Pull Request #481: Decompiler

1804 of 7561 branches covered (23.86%)

Branch coverage included in aggregate %.

100 of 1839 new or added lines in 29 files covered. (5.44%)

41 existing lines in 6 files now uncovered.

4093 of 11850 relevant lines covered (34.54%)

165575.01 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

9.09
/Cpp2IL.Core/ISIL/MemoryOperand.cs
1
using System;
2
using System.Text;
3

4
namespace Cpp2IL.Core.ISIL;
5

6
/// <summary>
7
/// Memory operand in the format of [base+addend+index*scale]
8
/// </summary>
9
public struct MemoryOperand(object? baseRegister = null, object? indexRegister = null, long addend = 0, int scale = 0)
10
{
11
    public object? Base = baseRegister;
6✔
12
    public object? Index = indexRegister;
6✔
13
    public long Addend = addend;
6✔
14
    public int Scale = scale;
6✔
15

NEW
16
    public bool IsConstant => Base == null && Index == null && Scale == 0;
×
17

18
    public override string ToString()
19
    {
NEW
20
        var sb = new StringBuilder("[");
×
NEW
21
        var needsPlus = false;
×
22

NEW
23
        if (Base != null)
×
24
        {
NEW
25
            sb.Append(Base);
×
NEW
26
            needsPlus = true;
×
27
        }
28

NEW
29
        if (Addend != 0)
×
30
        {
NEW
31
            if (needsPlus || Addend < 0)
×
NEW
32
                sb.Append(Addend > 0 ? '+' : '-');
×
NEW
33
            sb.Append($"{Math.Abs(Addend):X}");
×
NEW
34
            needsPlus = true;
×
35
        }
36

NEW
37
        if (Index != null)
×
38
        {
NEW
39
            if (needsPlus)
×
NEW
40
                sb.Append('+');
×
NEW
41
            sb.Append(Index);
×
42

NEW
43
            if (Scale > 1)
×
44
            {
NEW
45
                sb.Append('*');
×
NEW
46
                sb.Append(Scale);
×
47
            }
48
        }
49

NEW
50
        sb.Append(']');
×
NEW
51
        return sb.ToString();
×
52
    }
53
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc