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

SamboyCoding / Cpp2IL / 17101091060

20 Aug 2025 02:16PM UTC coverage: 30.421% (-3.9%) from 34.352%
17101091060

Pull #481

github

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

1804 of 7551 branches covered (23.89%)

Branch coverage included in aggregate %.

102 of 1827 new or added lines in 35 files covered. (5.58%)

40 existing lines in 6 files now uncovered.

4095 of 11840 relevant lines covered (34.59%)

165714.86 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

© 2026 Coveralls, Inc