• 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

0.0
/Cpp2IL.Core/Actions/ResolveFieldOffsets.cs
1
using System.Linq;
2
using Cpp2IL.Core.ISIL;
3
using Cpp2IL.Core.Model.Contexts;
4

5
namespace Cpp2IL.Core.Actions;
6

7
public class ResolveFieldOffsets : IAction
8
{
9
    public void Apply(MethodAnalysisContext method)
10
    {
NEW
11
        foreach (var instruction in method.ControlFlowGraph!.Instructions)
×
12
        {
NEW
13
            for (var i = 0; i < instruction.Operands.Count; i++)
×
14
            {
NEW
15
                var operand = instruction.Operands[i];
×
16

NEW
17
                if (operand is not MemoryOperand memory)
×
18
                    continue;
19

20
                // Has to be [base (local) + addend (field offset)]
NEW
21
                if (memory.Index != null || memory.Scale != 0)
×
22
                    continue;
23

NEW
24
                if (memory.Base is not LocalVariable local || local?.Type == null)
×
25
                    continue;
26

NEW
27
                var field = local.Type.Fields.FirstOrDefault(f => f.BackingData?.FieldOffset == memory.Addend);
×
28

NEW
29
                if (field == null) // TODO: Support nested fields (Field1.Field2.Field3)
×
30
                    continue;
31

NEW
32
                instruction.Operands[i] = new FieldReference(field, local, (int)memory.Addend);
×
33
            }
34
        }
NEW
35
    }
×
36
}
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